IGameInput::GetCurrentTimestamp

Returns a GameInput timestamp, taken at the moment the method is called.

Syntax

uint64_t GetCurrentTimestamp(  
)  

Parameters

Return value

Type: uint64_t

Timestamp measure in microseconds.

Remarks

The GameInput API uses QPC time, expressed in microseconds, as the currency for its timestamps and other temporal functionality. Using a monotonically increasing counter instead of the system time ensures that no jitter is introduced as a result of system clock adjustments. Several methods within the GameInput API either return timestamp values or take timestamp values as an input. This method enables applications to reason about the values of other timestamps, relative to the present. You can use GetCurrentTimeStamp in functions like IGameInputDevice::SetRumbleState which takes a timestamp as a parameter to determine when to take some action. You can also use this to reason about readings and when they happened relative to now by comparing the results with the results of IGameInputReading::GetTimeStamp.

Requirements

Header: GameInput.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

Input API Overview
IGameInput
IGameInputReading::GetTimeStamp
IGameInputDevice::SetRumbleState