← API Reference Namespace

asge::time

Namespaces

Typedefs

#using SystemClock = std::chrono::system_clock
#using SteadyClock = std::chrono::steady_clock
#using Seconds = std::chrono::duration< float >
#using Timestamp = SystemClock::time_point
#using Timepoint = SteadyClock::time_point
#using Duration = SteadyClock::duration

Functions

#float DeltaTime() noexcept

Get the scaled frame delta time in seconds.

Returns the frame delta after pause and time scaling have been applied.

#float UnscaledDeltaTime() noexcept

Returns the frame delta without pause or time scaling.

#float ElapsedTime() noexcept

Get the total accumulated scaled runtime.

Returns the elapsed engine time in seconds after applying pause and time scaling.

#std::uint64_t FrameIndex() noexcept

Get the current frame index.

#float Scale() noexcept

Get the current global time scale.

#void Scale(float inScale) noexcept

Set the global time scale multiplier.

Values greater than 1 accelerate time, while values between 0 and 1 slow it down.

Parameters
inScale

New time scale multiplier

#bool Paused() noexcept

Check whether time progression is paused.

When paused, Delta() returns zero while UnscaledDelta() continues updating.

Returns

True if paused

#void Pause(bool inPause) noexcept

Pause or resume scaled time progression.

Parameters
inPause

True to pause, false to resume

#void TargetFPS(std::uint64_t inFps) noexcept
#Timestamp Now() noexcept
#Timepoint SteadyNow() noexcept
#std::tm LocalTime(Timestamp const &inTimestamp) noexcept
#std::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>.

Parameters
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