public static member function
<chrono>
std::chrono::duration::max
static constexpr duration max();
Duration maximum value
Returns the maximum value of duration.
The function calls duration_value::max to obtain the maximum value for its internal count object:
1 2 3
|
static constexpr duration max() {
return duration_values<rep>::max();
}
| |
Return value
A duration object with its highest possible value.
Example
1 2 3 4 5 6 7 8 9 10 11
|
// duration::min/max
#include <iostream>
#include <chrono>
int main ()
{
std::cout << "system_clock durations can represent:\n";
std::cout << "min: " << std::chrono::system_clock::duration::min().count() << "\n";
std::cout << "max: " << std::chrono::system_clock::duration::max().count() << "\n";
return 0;
}
| |
Possible output:
system_clock durations can represent:
min: -9223372036854775808
max: 9223372036854775807
|