Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a39cb4b

Browse files
committedDec 14, 2022
gl.js: use performance timer
Use performance.now instead of Date.now, which may provide a higher-resolution time (depending on the browser's Spectre mitigation settings). The time returned will no longer be relative to the Unix epoch and system clock.
1 parent 124aca8 commit a39cb4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎js/gl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ var importObject = {
615615
return Math.floor(Math.random() * 2147483647);
616616
},
617617
now: function () {
618-
return Date.now() / 1000.0;
618+
return performance.now() / 1000.0;
619619
},
620620
canvas_width: function () {
621621
return Math.floor(canvas.width);

0 commit comments

Comments
 (0)
Please sign in to comment.