Skip to main content

NT_GetServerTimeOffset

Function NT_GetServerTimeOffset 

Source
pub unsafe extern "C" fn NT_GetServerTimeOffset(
    inst: NT_Inst,
    valid: *mut NT_Bool,
) -> i64
Expand description

Get the time offset between server time and local time. Add this value to local time to get the estimated equivalent server time. In server mode, this always returns a valid value of 0. In client mode, this returns the time offset only if the client and server are connected and have exchanged synchronization messages. Note the time offset may change over time as it is periodically updated; to receive updates as events, add a listener to the “time sync” event.

§Parameters

  • inst: Instance handle.
  • valid: Set to true if the return value is valid, false otherwise (output).

§Returns

Time offset in microseconds (if valid is set to true).