libstdc++
|
ISO C++ 2014 namespace for suffixes for duration literals.
These suffixes can be used to create chrono::duration
values with tick periods of hours, minutes, seconds, milliseconds, microseconds or nanoseconds. For example, std::chrono::seconds(5)
can be written as 5s
after making the suffix visible in the current scope. The suffixes can be made visible by a using-directive or using-declaration such as:
using namespace std::chrono_literals;
using namespace std::literals;
using namespace std::chrono;
using namespace std;
using std::chrono_literals::operator""s;
The result of these suffixes on an integer literal is one of the standard typedefs such as std::chrono::hours
. The result on a floating-point literal is a duration type with the specified tick period and an unspecified floating-point representation, for example 1.5e2ms
might be equivalent to chrono::duration<long double, chrono::milli>(1.5e2)
.