Skip to content

TSdlTimerNSCallback

Function prototype for the nanosecond timer callback function.

The callback function is passed the current timer interval and returns the next timer interval, in nanoseconds. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled. If the callback returns 0, the periodic alarm is canceled and will be removed.

Definition

Unit: Neslib.Sdl3.Time

type TSdlTimerNSCallback = function(const ATimerID: TSdlTimerID; 
  const AInterval: Int64): Int64 of object

Parameters

ATimerID: TSdlTimerID : The current timer being processed.

AInterval: Int64 : The current callback time interval.

Returns

Int64: The new callback time interval, or 0 to disable further runs of the callback.

See Also

Remarks

SDL may call this callback at any time from a background thread; the application is responsible for locking resources the callback touches that need to be protected.