duration Class
Describes a type that holds a time interval, which is an elapsed time between two time points.
template<
class Rep,
class Period = ratio<1>
>
class duration;
template<
class Rep,
class Period
>
class duration;
template<
class Rep,
class Period1,
class Period2
>
class duration
<duration<Rep, Period1>, Period2>;
Remarks
The template argument Rep describes the type that is used to hold the number of clock ticks in the interval. The template argument Period is an instantiation of ratio that describes the size of the interval that each tick represents.
Members
Public Typedefs
Name |
Description |
---|---|
duration::period Typedef |
Represents a synonym for the template parameter Period. |
duration::rep Typedef |
Represents a synonym for the template parameter Rep. |
Public Constructors
Name |
Description |
---|---|
Constructs a duration object. |
Public Methods
Name |
Description |
---|---|
Returns the number of clock ticks in the time interval. |
|
Static. Returns the maximum allowable value of template parameter Ref. |
|
Static. Returns the lowest allowable value of template parameter Ref. |
|
Static. In effect, returns Rep(0). |
Public Operators
Name |
Description |
---|---|
Returns a copy of the duration object together with a negated tick count. |
|
Decrements the stored tick count. |
|
Reduces the stored tick count modulo a specified value. |
|
Multiplies the stored tick count by a specified value. |
|
Divides the stored tick count by the tick count of a specified duration object. |
|
Returns *this. |
|
Increments the stored tick count. |
|
Adds the tick count of a specified duration object to the stored tick count. |
|
Subtracts the tick count of a specified duration object from the stored tick count. |
Requirements
Header: chrono
Namespace: std::chrono