Getting duration units??

Hi,

If you have a
time_point
, is there a way to find out what units of
duration
it uses?

Thanks,
Juan
1
2
3
4
5
6
template < typename TIME_POINT > constexpr double ticks_per_second()
{
    using duration = typename TIME_POINT::duration ;
    using period = typename duration::period ;
    return double(period::den) / period::num ;
}

http://coliru.stacked-crooked.com/a/b79e7da4d18bd2da
Topic archived. No new replies allowed.