asge::time
Namespaces
Typedefs
using SystemClock = std::chrono::system_clockusing SteadyClock = std::chrono::steady_clockusing Seconds = std::chrono::duration< float >using Timestamp = SystemClock::time_pointusing Timepoint = SteadyClock::time_pointusing Duration = SteadyClock::durationFunctions
float DeltaTime() noexceptGet the scaled frame delta time in seconds.
Returns the frame delta after pause and time scaling have been applied.
float UnscaledDeltaTime() noexceptReturns the frame delta without pause or time scaling.
float ElapsedTime() noexceptGet the total accumulated scaled runtime.
Returns the elapsed engine time in seconds after applying pause and time scaling.
std::uint64_t FrameIndex() noexceptGet the current frame index.
float Scale() noexceptGet the current global time scale.
void Scale(float inScale) noexceptSet the global time scale multiplier.
Values greater than 1 accelerate time, while values between 0 and 1 slow it down.
inScale | New time scale multiplier |
bool Paused() noexceptCheck whether time progression is paused.
When paused, Delta() returns zero while UnscaledDelta() continues updating.
True if paused
void Pause(bool inPause) noexceptPause or resume scaled time progression.
inPause | True to pause, false to resume |
void TargetFPS(std::uint64_t inFps) noexceptstd::tm LocalTime(Timestamp const &inTimestamp) noexceptstd::string FormatTimestamp(Timestamp const &inTimestamp, char const *inFormat)Format the input timestamp into string.
Given an input timestamp and the formatting string it returns the formatted string plus the milliseconds precision like: <format>.<ms>.
inTimestamp | The input timestamp (system clock time point) |
inFormat | The formatting string for the timestamp |
template<typename T> std::int64_t NanosFrom(std::chrono::time_point< T > inStart) noexcept