std::chrono::high_resolution_clock
From cppreference.com
Defined in header <chrono>
|
||
class high_resolution_clock; |
(since C++11) | |
Class std::chrono::high_resolution_clock
represents the clock with the smallest tick period provided by the implementation. It may be an alias of std::chrono::system_clock or std::chrono::steady_clock, or a third, independent clock.
std::chrono::high_resolution_clock
meets the requirements of TrivialClock.
Contents |
[edit] Member types
Type | Definition |
rep
|
arithmetic type representing the number of ticks in the clock's duration |
period
|
a std::ratio type representing the tick period of the clock, in seconds |
duration
|
std::chrono::duration<rep, period> |
time_point
|
std::chrono::time_point<std::chrono::high_resolution_clock> |
[edit] Member constants
constexpr bool is_steady [static] |
true if the time between ticks is always constant, i.e. calls to now() return values that increase monotonically even in case of some external clock adjustment, otherwise false (public static member constant) |
[edit] Member functions
[static] |
returns a std::chrono::time_point representing the current value of the clock (public static member function) |
[edit] Notes
There has been some controversy around the use of high_resolution_clock
. Howard Hinnant, who claims to have introduced high_resolution_clock
to the language, stated in 2016 on the ISO C++ Standard - Discussion mailing list that he was in favor of deprecating it. His rationale was that, because the standard allows for it to be an alias for