Skip to content

class Timestep (client-side)

Available since version: 0.1.9.5

Note

Use WorldTimer global object to work with game time step properties.

This class represents time step object.
It can be used to measure different time intervals like: frameTime, totalTime.

Properties

float factorMotion

Available since version: 0.1.9.5

Represents the motion factor of a timestep.
This ration will be used to adjust the timestep values in reset method.


float frameTime (read-only)

Available since version: 0.1.9.5

Represents elapsed time between frames (delta time) in miliseconds since last update.


float totalTime (read-only)

Available since version: 0.1.9.5

Represents elapsed total time in miliseconds.


float frameTimeSecs (read-only)

Available since version: 0.1.9.5

Represents elapsed time between frames (delta time) in seconds since last update.


float totalTimeSecs (read-only)

Available since version: 0.1.9.5

Represents elapsed total time in seconds.


Methods

reset

Available since version: 0.1.9.5

This method will update time step values and it will take factor motion into account.
Call this method in onRender event, to update time step values by each frame.

void reset()

update

Available since version: 0.1.9.5

Note

This method will not take into account factor motion multiplier.

This method will update time step values by passed delta time.
Call this method in onRender event, to update time step values by each frame.

void update(float deltaTime)

Parameters:

  • float deltaTime: the time between frames in miliseconds.