⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

static class Time

This class contains time information for the current session and frame! Where StereoKit can see the display’s timing, steps and totals follow when frames reach the screen rather than when their code ran, so animation lands where the display shows it.

Static Fields and Properties

   
UInt64 Frame The number of frames/steps since the app started.
UInt64 PerfCPUus Microseconds of CPU work for the renderer during the most recently completed frame. This measures wall-clock time from command buffer acquisition through queue submission, excluding any time spent waiting on GPU fences or vsync. This is useful for identifying CPU-side rendering bottlenecks such as draw call overhead or resource uploads. Returns 0 if timing data is not yet available (first few frames).
UInt64 PerfGPUus Microseconds the GPU spent executing rendering commands for the most recently completed frame. Measured via hardware timestamp queries at the top and bottom of the Vulkan pipeline, so this reflects actual GPU execution time independent of CPU pacing or vsync. Useful for identifying GPU-bound scenarios like expensive shaders or overdraw. Returns 0 if timing data is not yet available (first few frames).
PresentStats PerfPresent How frames have been reaching the display recently: the latency from the last present call to its pixels, and how many recent frames were shown twice. StereoKit paces itself against the display in the Simulator and Window app modes, and this is the readout of that. In XR the runtime owns presentation, and Offscreen has no display, so both report zeros.
double Scale Time is scaled by this value! Want time to pass slower? Set it to 0.5! Faster? Try 2!
double Step How many seconds have elapsed since the last frame? 64 bit time precision, calculated at the start of the frame. Where StereoKit can see the display’s timing, this is the gap between when the previous frame and this one reach the screen, rather than between when their code ran.
float Stepf How many seconds have elapsed since the last frame? 32 bit time precision, calculated at the start of the frame.
double StepUnscaled How many seconds have elapsed since the last frame? 64 bit time precision, calculated at the start of the frame. This version is unaffected by the Time.Scale value!
float StepUnscaledf How many seconds have elapsed since the last frame? 32 bit time precision, calculated at the start of the frame. This version is unaffected by the Time.Scale value!
double Total How many seconds have elapsed since StereoKit was initialized? 64 bit time precision, calculated at the start of the frame.
float Totalf How many seconds have elapsed since StereoKit was initialized? 32 bit time precision, calculated at the start of the frame.
double TotalUnscaled How many seconds have elapsed since StereoKit was initialized? 64 bit time precision, calculated at the start of the frame. This version is unaffected by the Time.Scale value!
float TotalUnscaledf How many seconds have elapsed since StereoKit was initialized? 32 bit time precision, calculated at the start of the frame. This version is unaffected by the Time.Scale value!

Static Methods

   
SetTime This allows you to override the application time! The application will progress from this time using the current timescale.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!