Skip to content

timer

timer

Frame timing and the clock.

getTime

proc getTime(): float

Seconds since SDL init, as a high-resolution value.

Returns

float

getDelta

proc getDelta(nim2d: Nim2d): float

Seconds elapsed between the previous two frames.

Parameters

  • nim2d (Nim2d)

Returns

float

getFPS

proc getFPS(nim2d: Nim2d): float

The current frames per second, from the last frame's timing.

Parameters

  • nim2d (Nim2d)

Returns

float

sleep

proc sleep(seconds: float)

Pause the calling thread for a number of seconds.

Parameters

  • seconds (float)
Generated with mkdocstrings-nim