Procházet zdrojové kódy

Clock: Inline performance.now() (#31295)

林炳权 před 11 měsíci
rodič
revize
4bb436e68e
1 změnil soubory, kde provedl 2 přidání a 8 odebrání
  1. 2 8
      src/core/Clock.js

+ 2 - 8
src/core/Clock.js

@@ -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 };

粤ICP备19079148号