title | ms.custom | ms.date | ms.reviewer | ms.suite | ms.tgt_pltfrm | ms.topic | f1_keywords | ms.assetid | caps.latest.revision | manager | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
<chrono> functions | Microsoft Docs |
11/04/2016 |
article |
|
d6800e15-77a1-4df3-900e-d8b2fee190c7 |
10 |
ghogen |
duration_cast | time_point_cast |
Casts a duration
object to a specified type.
template <class To, class Rep, class Period>
constexpr To duration_cast(const duration<Rep, Period>& Dur);
A duration
object of type To
that represents the time interval Dur
, which is truncated if it has to fit into the target type.
If To
is an instantiation of duration
, this function does not participate in overload resolution.
Casts a time_point object to a specified type.
template <class To, class Clock, class Duration>
time_point<Clock, To> time_point_cast(const time_point<Clock, Duration>& Tp);
A time_point
object that has a duration of type To
.
Unless To
is an instantiation of duration, this function does not participate in overload resolution.