MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / Timer

Class Timer

src/core/Timer.js:15–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 */
14
15export class Timer {
16
17 /**
18 * Constructs a new timer.
19 */
20
21 constructor() {
22
23 /**
24 * The start time in milliseconds.
25 *
26 * @type {Number}
27 * @private
28 */
29
30 this.startTime = performance.now();
31
32 /**
33 * The previous time in milliseconds.
34 *
35 * @type {Number}
36 * @private
37 */
38
39 this.previousTime = 0;
40
41 /**
42 * The current time in milliseconds.
43 *
44 * @type {Number}
45 * @private
46 */
47
48 this.currentTime = 0;
49
50 /**
51 * The most recent delta time in milliseconds.
52 *
53 * @type {Number}
54 * @private
55 * @see {@link delta}
56 */
57
58 this._delta = 0;
59
60 /**
61 * The total elapsed time in milliseconds.
62 *
63 * @type {Number}
64 * @private
65 * @see {@link elapsed}
66 */
67
68 this._elapsed = 0;
69
70 /**
71 * The fixed time step in milliseconds. Default is 16.667 (60 fps).
72 *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…