tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
duration.hpp File Reference

Go to the source code of this file.

Classes

struct  common_type< chrono::duration< Rep1, Period1 >, chrono::duration< Rep2, Period2 > >
 Exposes the type named type, which is the common type of two etl::chrono::durations, whose period is the greatest common divisor of Period1 and Period2. More...
 
struct  duration< Rep, Period >
 Class template etl::chrono::duration represents a time interval. More...
 

Namespaces

namespace  etl
 
namespace  etl::chrono
 
namespace  etl::literals
 
namespace  etl::literals::chrono_literals
 

Typedefs

using days = duration<int_least32_t, ratio<86400>>
 Signed integer type of at least 25 bits.
 
using hours = duration<int_least32_t, ratio<3600>>
 Signed integer type of at least 23 bits.
 
using microseconds = duration<int_least64_t, micro>
 Signed integer type of at least 55 bits.
 
using milliseconds = duration<int_least64_t, milli>
 Signed integer type of at least 45 bits.
 
using minutes = duration<int_least32_t, ratio<60>>
 Signed integer type of at least 29 bits.
 
using months = duration<int_least32_t, ratio<31556952>>
 Signed integer type of at least 20 bits.
 
using nanoseconds = duration<int_least64_t, nano>
 Signed integer type of at least 64 bits.
 
using seconds = duration<int_least64_t>
 Signed integer type of at least 35 bits.
 
using weeks = duration<int_least32_t, ratio<604800>>
 Signed integer type of at least 22 bits.
 
using years = duration<int_least32_t, ratio<2629746>>
 Signed integer type of at least 17 bits.
 

Functions

template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator!= (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> bool
 Compares two durations. Checks if lhs and rhs are equal, i.e. the number of ticks for the type common to both durations are equal.
 
constexpr auto operator""_h (long double h) -> etl::chrono::duration< long double, ratio< 3600, 1 > >
 Forms a etl::chrono::duration literal representing hours. Floating-point literal, returns a floating-point duration equivalent to etl::chrono::hours.
 
constexpr auto operator""_h (unsigned long long h) -> etl::chrono::hours
 Forms a etl::chrono::duration literal representing hours. Integer literal, returns exactly etl::chrono::hours(hrs).
 
constexpr auto operator""_min (long double m) -> etl::chrono::duration< long double, etl::ratio< 60, 1 > >
 Forms a etl::chrono::duration literal representing minutes. Floating-point literal, returns a floating-point duration equivalent to etl::chrono::minutes.
 
constexpr auto operator""_min (unsigned long long m) -> etl::chrono::minutes
 Forms a etl::chrono::duration literal representing minutes. Integer literal, returns exactly etl::chrono::minutes(mins).
 
constexpr auto operator""_ms (long double m) -> etl::chrono::duration< long double, etl::milli >
 Forms a etl::chrono::duration literal representing milliseconds. Floating-point literal, returns a floating-point duration equivalent to etl::chrono::milliseconds.
 
constexpr auto operator""_ms (unsigned long long m) -> etl::chrono::milliseconds
 Forms a etl::chrono::duration literal representing milliseconds. Integer literal, returns exactly etl::chrono::milliseconds(mins).
 
constexpr auto operator""_ns (long double m) -> etl::chrono::duration< long double, etl::nano >
 Forms a etl::chrono::duration literal representing nanoseconds. Floating-point literal, returns a floating-point duration equivalent to etl::chrono::nanoseconds.
 
constexpr auto operator""_ns (unsigned long long m) -> etl::chrono::nanoseconds
 Forms a etl::chrono::duration literal representing nanoseconds. Integer literal, returns exactly etl::chrono::nanoseconds(mins).
 
constexpr auto operator""_s (long double m) -> etl::chrono::duration< long double >
 Forms a etl::chrono::duration literal representing seconds. Floating-point literal, returns a floating-point duration equivalent to etl::chrono::seconds.
 
constexpr auto operator""_s (unsigned long long m) -> etl::chrono::seconds
 Forms a etl::chrono::duration literal representing seconds. Integer literal, returns exactly etl::chrono::seconds(mins).
 
constexpr auto operator""_us (long double m) -> etl::chrono::duration< long double, etl::micro >
 Forms a etl::chrono::duration literal representing microseconds. Floating-point literal, returns a floating-point duration equivalent to etl::chrono::microseconds.
 
constexpr auto operator""_us (unsigned long long m) -> etl::chrono::microseconds
 Forms a etl::chrono::duration literal representing microseconds. Integer literal, returns exactly etl::chrono::microseconds(mins).
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator% (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > >
 Performs basic arithmetic operations between two durations or between a duration and a tick count.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator+ (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > >
 Performs basic arithmetic operations between two durations or between a duration and a tick count.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator- (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > >
 Performs basic arithmetic operations between two durations or between a duration and a tick count.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator/ (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> common_type_t< Rep1, Rep2 >
 Performs basic arithmetic operations between two durations or between a duration and a tick count.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator< (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> bool
 Compares two durations. Compares lhs to rhs, i.e. compares the number of ticks for the type common to both durations.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator<= (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> bool
 Compares two durations. Compares lhs to rhs, i.e. compares the number of ticks for the type common to both durations.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator== (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> bool
 Compares two durations. Checks if lhs and rhs are equal, i.e. the number of ticks for the type common to both durations are equal.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator> (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> bool
 Compares two durations. Compares lhs to rhs, i.e. compares the number of ticks for the type common to both durations.
 
template<typename Rep1, typename Period1, typename Rep2, typename Period2>
constexpr auto operator>= (duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> bool
 Compares two durations. Compares lhs to rhs, i.e. compares the number of ticks for the type common to both durations.