WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
fpga_clock.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2017. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <chrono>
11 #include <limits>
12 
13 namespace hal {
14 
15 class fpga_clock {
16  public:
17  typedef std::chrono::microseconds::rep rep;
18  typedef std::chrono::microseconds::period period;
19  typedef std::chrono::microseconds duration;
20  typedef std::chrono::time_point<fpga_clock> time_point;
21 
22  static fpga_clock::time_point now() noexcept;
23  static constexpr bool is_steady = true;
24 
25  static constexpr fpga_clock::time_point epoch() { return time_point(zero()); }
26 
27  static constexpr fpga_clock::duration zero() { return duration(0); }
28 
29  static constexpr time_point min_time{
30  time_point(duration(std::numeric_limits<duration::rep>::min()))};
31 };
32 } // namespace hal
Definition: fpga_clock.h:15