WPILibC++  2018.4.1-20180729133221-1141-g00c2cd7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
fpga_clock.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2017-2018 FIRST. 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 
18 class fpga_clock {
19  public:
20  typedef std::chrono::microseconds::rep rep;
21  typedef std::chrono::microseconds::period period;
22  typedef std::chrono::microseconds duration;
23  typedef std::chrono::time_point<fpga_clock> time_point;
24 
25  static fpga_clock::time_point now() noexcept;
26  static constexpr bool is_steady = true;
27 
28  static fpga_clock::time_point epoch() noexcept { return time_point(zero()); }
29 
30  static fpga_clock::duration zero() noexcept { return duration(0); }
31 
32  static const time_point min_time;
33 };
34 } // namespace hal
Definition: NotifyListenerVector.h:18
A std::chrono compatible wrapper around the FPGA Timer.
Definition: fpga_clock.h:18