class

FTime

The process-wide frame clock: one real time that never stretches, one game time that does, and the frame number everything else keys off.

Module
Core
Header
#include "Core/FTime.h"
Namespace
Mowo

Every accessor is out-of-line and the state lives in exactly one translation unit inside Core.dll. Nothing here may become an inline member reading a header-declared static — that shape gives each consuming DLL its own copy of the clock, and two modules then disagree about what frame it is without anything failing loudly.

Properties

TypeNameDescription
static constexpr int32_tkMaxSmoothingFramesUpper bound on the smoothing window, and the size of the ring the implementation keeps. Default 32.

Public functions

ReturnsNameDescription
voidBeginFrameAdvance one frame.
voidBeginFrameSame, measuring the delta off the platform clock.
voidResetFrame 0, time 0, dilation 1, unpaused.
doubleGetRealTimeSecondsReal time — never dilated, never paused.
floatGetDeltaSeconds
floatGetUnclampedDeltaSeconds
uint64_tGetFrameNumber
doubleGetGameTimeSecondsGame time — scaled by the dilation and frozen while paused.
floatGetScaledDeltaSeconds
floatGetTimeDilation
voidSetTimeDilation
boolIsPaused
voidSetPaused
floatGetEffectiveTimeDilationThe dilation actually in force: zero while paused.
floatTimeSinceGame seconds elapsed since a game-time stamp.
voidSetMaxDeltaSecondsDelta clamp, 0.25 s by default.
doubleGetMaxDeltaSeconds
voidSetFixedDeltaSecondsFixed timestep.
doubleGetFixedDeltaSeconds
boolIsUsingFixedTimestep
voidSetSmoothingFramesRolling mean across the last N clamped deltas.
int32_tGetSmoothingFrames
voidSetTargetFrameRateFrame pacing.
int32_tGetTargetFrameRate
voidPaceFrame
doubleSecondsUntilTargetSeconds left before this frame's period at hz is up, or 0 when it is already over.
voidInitFromCommandLineReads --fixed-dt=<seconds>, --fps=<hz> and --max-delta=<seconds>.
doubleGetPlatformSecondsMonotonic platform seconds, independent of the frame loop.

Function details

BeginFrame

C++
static void BeginFrame(double rawDeltaSeconds)

Advance one frame. Engine::Run is the single caller in a hosted process; headless drivers and tests call it themselves. rawDeltaSeconds is the measured wall time. The clamp, the smoothing window and the fixed-timestep override are applied in here so that no caller has to reproduce them.

BeginFrame

C++
static void BeginFrame()

Same, measuring the delta off the platform clock. The first call after Reset() reports a zero delta rather than the time since process start.

Reset

C++
static void Reset()

Frame 0, time 0, dilation 1, unpaused. Configuration (clamp, fixed step, smoothing window, frame cap) survives.

GetRealTimeSeconds

C++
static double GetRealTimeSeconds()

Real time — never dilated, never paused. Advances by the UNCLAMPED delta, so a hitch stays visible in the numbers a capture records.

GetDeltaSeconds

C++
static float GetDeltaSeconds()

GetUnclampedDeltaSeconds

C++
static float GetUnclampedDeltaSeconds()

GetFrameNumber

C++
static uint64_t GetFrameNumber()

GetGameTimeSeconds

C++
static double GetGameTimeSeconds()

Game time — scaled by the dilation and frozen while paused.

GetScaledDeltaSeconds

C++
static float GetScaledDeltaSeconds()

GetTimeDilation

C++
static float GetTimeDilation()

SetTimeDilation

C++
static void SetTimeDilation(float dilation)

IsPaused

C++
static bool IsPaused()

SetPaused

C++
static void SetPaused(bool paused)

GetEffectiveTimeDilation

C++
static float GetEffectiveTimeDilation()

The dilation actually in force: zero while paused. This is the factor a world applies to its tick delta.

TimeSince

C++
static float TimeSince(double gameTimeSeconds)

Game seconds elapsed since a game-time stamp. Constant across a pause, which is the reason gameplay stamps game time and not real time.

SetMaxDeltaSeconds

C++
static void SetMaxDeltaSeconds(double seconds)

Delta clamp, 0.25 s by default. A debugger break otherwise hands the physics step a delta it cannot integrate.

GetMaxDeltaSeconds

C++
static double GetMaxDeltaSeconds()

SetFixedDeltaSeconds

C++
static void SetFixedDeltaSeconds(double seconds)

Fixed timestep. Greater than zero makes every frame report exactly this delta whatever the wall clock did, which is what makes a capture replay to the same numbers. Set from --fixed-dt=<seconds> or --fps=<hz>.

GetFixedDeltaSeconds

C++
static double GetFixedDeltaSeconds()

IsUsingFixedTimestep

C++
static bool IsUsingFixedTimestep()

SetSmoothingFrames

C++
static void SetSmoothingFrames(int32_t frames)

Rolling mean across the last N clamped deltas. 0 or 1 = off (the default). Ignored under a fixed timestep.

GetSmoothingFrames

C++
static int32_t GetSmoothingFrames()

SetTargetFrameRate

C++
static void SetTargetFrameRate(int32_t hz)

Frame pacing. Sleeps the bulk of the remaining budget through the OS and spins only the last slice — a plain sleep overshoots by most of a scheduler tick, a plain spin burns a core for the whole frame. hz <= 0 returns immediately.

GetTargetFrameRate

C++
static int32_t GetTargetFrameRate()

PaceFrame

C++
static void PaceFrame(int32_t hz, bool precise)

SecondsUntilTarget

C++
static double SecondsUntilTarget(int32_t hz)

Seconds left before this frame's period at hz is up, or 0 when it is already over. For a caller that wants to wait that time on something other than a sleep — a throttled editor waits on the OS event queue so the first input after a pause is not stuck behind a 40 ms nap.

InitFromCommandLine

C++
static void InitFromCommandLine()

Reads --fixed-dt=<seconds>, --fps=<hz> and --max-delta=<seconds>. Idempotent; BeginFrame runs it once if nothing else did.

GetPlatformSeconds

C++
static double GetPlatformSeconds()

Monotonic platform seconds, independent of the frame loop. What PaceFrame measures against.

Generated from Core/FTime.h via core.json · Nov 5, 2026Version 1.0.0