Kiwi.Time.MasterClock Class
The MasterClock tracks time elapsed since the application started. Each ClockManager has only one MasterClock which is automatically generated when the game initially booted. You should not access it directly, use the Clock and Timer classes instead.
Constructor
Item Index
Methods
elapsed
()
Number
public
The time that has elapsed since the game started. In milliseconds.
Returns:
elapsedSecondsSince
-
since
Used to calculate the elapsed time from a point that is specified BUT this is in seconds.
Parameters:
-
since
NumberThe point in time in which you would like to see how many seconds have passed. In milliseconds.
Returns:
elapsedSince
-
since
Used to calculate the elapsed time from a point that is specified. This is returned in Milliseconds.
Parameters:
-
since
NumberThe point in time in which you would like to see how many milliseconds have passed. In milliseconds.
Returns:
objType
()
String
public
The type of object that this is.
Returns:
reset
()
public
Resets the MasterClocks time.
totalElapsedSeconds
()
Number
public
The time that has elapsed since the game started but in seconds.
Returns:
update
()
public
The update loop that should be executed every frame. Used to update the time.
Properties
_started
Number
private
The time when the MasterClock was started.
delta
Number
public
The time it takes for the time to update. Using this you can calculate the fps.
now
Number
public
The current time, this is straight from the Date.now() method and is updated every frame BEFORE the delta.
time
Number
public
The current time. This is updated every frame but AFTER the delta is calculated.