std::chrono::duration
From Cppreference
C++ Standard Library | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Utilities library | ||||||||||||||||||||||||||||||||||||||||
Date and time utilities | ||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||
std::chrono::duration | ||||||||||||||||||||||||||||||||||||||||
Template:cpp/chrono/duration/sidebar content | ||||||||||||||||||||||||||||||||||||||||
Defined in header <chrono>
|
||
template<
class Rep, |
(since C++11) | |
Class template std::chrono::duration represents a time interval. It is represented by a count of ticks and a tick period, where the tick period is the number of seconds from one tick to the next, represented as a compile-time rational constant.
Contents |
[edit] Member types
Member type | Definition |
rep | Rep, an arithmetic type representing the number of ticks |
period | Period, an std::ratio type representing the tick period |
[edit] Member functions
constructs new duration (public member function) |
|
destructs a duration (public member function) |
|
assigns the contents (public member function) |
|
returns the count of ticks (public member function) |
|
returns the special duration value zero (public member function) |
|
returns the special duration value min (public member function) |
|
returns the special duration value max (public member function) |
|
implements unary + and unary - (public member function) |
|
increments or decrements the tick count (public member function) |
|
implements compound assignment between two durations (public member function) |
[edit] Non-member types
This section is incomplete Reason: formatting |
Type | Definition |
nanoseconds | duration type with Period std::nano |
microseconds | duration type with Period std::micro |
milliseconds | duration type with Period std::milli |
seconds | duration type with Period std::ratio<1> |
minutes | duration type with Period std::ratio<60> |
hours | duration type with Period std::ratio<3600> |
[edit] Non-member functions
specializes the std::common_type trait (class template specialization) |
|
compares two durations (public member function) |
|
converts a duration to another, with a different tick interval (public member function) |
[edit] Helper classes
indicates that a duration is convertible to duration with different tick period (class template) |
|
constructs zero, min, and max values of a tick count of given type (class template) |