Constructor
new Clock()
Initialize required variables and begin tracking time.
Methods
getDeltaTime() → {number}
Return the time (seconds) since the last time the update method was called.
Returns:
time (seconds) since last update
- Type
- number
getElapsedTime() → {number}
Return the time (seconds) since the last time the update method was called.
Returns:
time (seconds) since clock was created
- Type
- number
update()
Update the values for delta time and elapsed time.
This method should be called once per frame by the Game class.
This method should be called once per frame by the Game class.