std::chrono::round(std::chrono::time_point) (3) - Linux Manuals
std::chrono::round(std::chrono::time_point): std::chrono::round(std::chrono::time_point)
NAME
std::chrono::round(std::chrono::time_point) - std::chrono::round(std::chrono::time_point)
Synopsis
Defined in header <chrono>
template <class ToDuration, class Clock, class Duration> (since C++17)
constexpr time_point<Clock, ToDuration> round(const time_point<Clock, Duration>& tp);
Returns the nearest time point to tp representable in ToDuration, rounding to even in halfway cases.
The function does not participate in the overload resolution unless ToDuration is an specialization of std::chrono::duration and std::chrono::treat_as_floating_point<typename ToDuration::rep>::value is false.
Parameters
tp - time point to round to nearest
Return value
d rounded to nearest time point using duration of type ToDuration, rounding to even in halfway cases.
Possible implementation
Example
This section is incomplete
Reason: no example
See also
time_point_cast (function template)
ceil(std::chrono::time_point) converts a time_point to another, rounding up
(C++17)
floor(std::chrono::time_point) converts a time_point to another, rounding down
(C++17)
round(std::chrono::duration) converts a duration to another, rounding to nearest, ties to even
(C++17)
round
roundf
roundl
lround
lroundf
lroundl
llround
llroundf
llroundl nearest integer, rounding away from zero in halfway cases
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)