|
|
@@ -61,7 +61,7 @@ class Clock {
|
|
|
*/
|
|
|
start() {
|
|
|
|
|
|
- this.startTime = now();
|
|
|
+ this.startTime = performance.now();
|
|
|
|
|
|
this.oldTime = this.startTime;
|
|
|
this.elapsedTime = 0;
|
|
|
@@ -110,7 +110,7 @@ class Clock {
|
|
|
|
|
|
if ( this.running ) {
|
|
|
|
|
|
- const newTime = now();
|
|
|
+ const newTime = performance.now();
|
|
|
|
|
|
diff = ( newTime - this.oldTime ) / 1000;
|
|
|
this.oldTime = newTime;
|
|
|
@@ -125,10 +125,4 @@ class Clock {
|
|
|
|
|
|
}
|
|
|
|
|
|
-function now() {
|
|
|
-
|
|
|
- return performance.now();
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
export { Clock };
|