37template <
class Ratio = std::ratio<1>>
38using Time = Unit<UnitKind::Time, Ratio>;
40template <
class ToTime,
class FromTime>
47std::chrono::duration<float>
to_chrono(Time<Ratio>
const& from)
49 return std::chrono::duration<float>(from.value());
57using Hour = Time<std::ratio<3600>>;
60constexpr auto operator""_ns(
long double n)
64constexpr auto operator""_us(
long double n)
68constexpr auto operator""_ms(
long double n)
72constexpr auto operator""_s(
long double n)
74 return Second(
static_cast<float>(n));
76constexpr auto operator""_min(
long double n)
78 return Minute(
static_cast<float>(n));
80constexpr auto operator""_h(
long double n)
82 return Hour(
static_cast<float>(n));
85constexpr auto operator""_ns(
unsigned long long n)
89constexpr auto operator""_us(
unsigned long long n)
93constexpr auto operator""_ms(
unsigned long long n)
97constexpr auto operator""_s(
unsigned long long n)
99 return Second(
static_cast<float>(n));
101constexpr auto operator""_min(
unsigned long long n)
103 return Minute(
static_cast<float>(n));
105constexpr auto operator""_h(
unsigned long long n)
107 return Hour(
static_cast<float>(n));
Time< std::ratio< 1, 1000000 > > Microsecond
ToTime time_cast(FromTime const &from)
Time< std::ratio< 1, 1000000000 > > Nanosecond
Unit< UnitKind::Time, Ratio > Time
Time< std::ratio< 1, 1000 > > Millisecond
std::chrono::duration< float > to_chrono(Time< Ratio > const &from)
Time< std::ratio< 3600 > > Hour
Time< std::ratio< 60 > > Minute
This file includes all the types the logdecoder script will decode.