Skip to content

Commit 559d1cd

Browse files
committed
NodeFrame: Use now()
1 parent 1c78abf commit 559d1cd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/nodes/core/NodeFrame.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,22 @@ class NodeFrame {
291291

292292
this.frameId ++;
293293

294-
if ( this.lastTime === undefined ) this.lastTime = performance.now();
294+
if ( this.lastTime === undefined ) this.lastTime = now();
295295

296-
this.deltaTime = ( performance.now() - this.lastTime ) / 1000;
296+
this.deltaTime = ( now() - this.lastTime ) / 1000;
297297

298-
this.lastTime = performance.now();
298+
this.lastTime = now();
299299

300300
this.time += this.deltaTime;
301301

302302
}
303303

304304
}
305305

306+
function now() {
307+
308+
return performance.now();
309+
310+
}
311+
306312
export default NodeFrame;

0 commit comments

Comments
 (0)