The time difference, in seconds, between the last frame of and the current frame recorded by the browser.
The scale on which time passes. The default value is 1.
For example, if set to 2, the time will run at twice the speed.
If set to 0.5, it will run at half the speed.
If set to 0, everything associated with the time will stop.
The time difference, in seconds, between the last frame and the current frame, unaffected by the scale.
The time difference, in seconds, between the last physics frame and the current one, unaffected by the scale.
The time difference, in seconds, between the last frame and the current frame.
The time difference, in seconds, between the last physics frame and the current one.
The browser delta time affected by time scale.
Sets a timer which executes a function repeatedly at a fixed time interval.
If times
is provided, the interval will be cleared after the function has been called that many times.
But if times
is not provided, the interval will continue until it is cleared.
If executeImmediately
is set to true, the function will be called immediately after the interval is set.
Intervals are cleared when loading a new scene.
intervalId
const intervalId = timeManager.setInterval({
callback: () => console.log("Will be called 5 times!"),
delay: 1000,
times: 5,
});
const intervalId = timeManager.setInterval({
callback: () => console.log("Will be called indefinitely!"),
delay: 1000,
});
const intervalId = timeManager.setInterval({
callback: () => console.log("Will be called immediately and indefinitely!"),
delay: 1000,
executeImmediately: true,
});
Manages the properties associated with time.
Example