GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
time.hpp File Reference

Go to the source code of this file.

Classes

struct  grem::Formatter< grem::DurationBase< Rep, Period > >

Namespaces

namespace  grem
namespace  grem::time_literals

Typedefs

template<intmax_t Num, intmax_t Den = 1>
using grem::Ratio = std::ratio<Num, Den>
template<typename Rep, typename Period = Ratio<1, 1>>
using grem::DurationBase = std::chrono::duration<Rep, Period>
template<typename Clock, typename Duration = typename Clock::duration>
using grem::TimePointBase = std::chrono::time_point<Clock, Duration>
using grem::Hours = DurationBase<int64_t, Ratio<60 * 60, 1>>
using grem::Minutes = DurationBase<int64_t, Ratio<60, 1>>
using grem::Seconds = DurationBase<int64_t, Ratio<1, 1>>
using grem::Milliseconds = DurationBase<int64_t, Ratio<1, 1'000>>
using grem::Microseconds = DurationBase<int64_t, Ratio<1, 1'000'000>>
using grem::Nanoseconds = DurationBase<int64_t, Ratio<1, 1'000'000'000>>
using grem::FloatHours = DurationBase<float, Ratio<60 * 60, 1>>
using grem::FloatMinutes = DurationBase<float, Ratio<60, 1>>
using grem::FloatSeconds = DurationBase<float, Ratio<1, 1>>
using grem::FloatMilliseconds = DurationBase<float, Ratio<1, 1'000>>
using grem::FloatMicroseconds = DurationBase<float, Ratio<1, 1'000'000>>
using grem::FloatNanoseconds = DurationBase<float, Ratio<1, 1'000'000'000>>

Functions

template<typename Timer, typename DeltaTime>
constexpr bool grem::countdown (Timer &timer, DeltaTime deltaTime)
 Subtract time from a time value and then check if it reached 0.
template<typename Timer, typename DeltaTime, typename TargetTime>
constexpr bool grem::countdown (Timer &timer, DeltaTime deltaTime, TargetTime targetTime)
 Subtract time from a time value and then check if it reached a given target time value.
template<typename Timer, typename DeltaTime, typename TargetTime>
constexpr bool grem::countup (Timer &timer, DeltaTime deltaTime, TargetTime targetTime)
 Add time to a time value and then check if it reached a given target time value.
template<typename Timer, typename DeltaTime, typename Interval>
constexpr size_t grem::countdownLoop (Timer &timer, DeltaTime deltaTime, Interval interval)
 Subtract time from a time value and then check how many times it reached 0 while looping back to a given time interval.
template<typename Timer, typename DeltaTime, typename Interval>
constexpr size_t grem::countupLoop (Timer &timer, DeltaTime deltaTime, Interval interval)
 Add time to a time value and then check how many times it reached a given time interval while looping back to 0.
template<typename Timer, typename DeltaTime, typename Interval>
constexpr size_t grem::countdownLoop (Timer &timer, DeltaTime deltaTime, Interval interval, bool active)
 Update a countdown loop with a boolean trigger that determines whether the loop is active or not.
template<typename Timer, typename DeltaTime, typename Interval>
constexpr size_t grem::countupLoop (Timer &timer, DeltaTime deltaTime, Interval interval, bool active)
 Update a countup loop with a boolean trigger that determines whether the loop is active or not.
consteval Seconds grem::time_literals::operator""_seconds (unsigned long long value)
consteval Seconds grem::time_literals::operator""_second (unsigned long long value)
consteval Milliseconds grem::time_literals::operator""_milliseconds (unsigned long long value)
consteval Milliseconds grem::time_literals::operator""_millisecond (unsigned long long value)
consteval Microseconds grem::time_literals::operator""_microseconds (unsigned long long value)
consteval Microseconds grem::time_literals::operator""_microsecond (unsigned long long value)
consteval Nanoseconds grem::time_literals::operator""_nanoseconds (unsigned long long value)
consteval Nanoseconds grem::time_literals::operator""_nanosecond (unsigned long long value)
consteval Minutes grem::time_literals::operator""_minutes (unsigned long long value)
consteval Minutes grem::time_literals::operator""_minute (unsigned long long value)
consteval Hours grem::time_literals::operator""_hours (unsigned long long value)
consteval Hours grem::time_literals::operator""_hour (unsigned long long value)