]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: small tweaks
authorEvan You <yyx990803@gmail.com>
Fri, 9 Nov 2018 01:37:19 +0000 (20:37 -0500)
committerEvan You <yyx990803@gmail.com>
Fri, 9 Nov 2018 01:37:19 +0000 (20:37 -0500)
packages/scheduler/src/experimental.ts

index 86972111905d9c89ff4726199e0a9d3756c91e38..118f3bc819500991402c5f19d213398388e8ab17 100644 (file)
@@ -18,7 +18,7 @@ type ErrorHandler = (err: Error) => any
 let currentJob: Job | null = null
 
 let start: number = 0
-const getNow = () => window.performance.now()
+const getNow = () => performance.now()
 const frameBudget = __JSDOM__ ? Infinity : 1000 / 60
 
 const patchQueue: Job[] = []
@@ -33,6 +33,7 @@ const pendingRejectors: ErrorHandler[] = []
 const p = Promise.resolve()
 
 function flushAfterMicroTask() {
+  start = getNow()
   return p.then(flush).catch(handleError)
 }
 
@@ -118,7 +119,6 @@ export function queueJob(rawJob: Function) {
 
   if (!hasPendingFlush) {
     hasPendingFlush = true
-    start = getNow()
     flushAfterMicroTask()
   }
 }