| 311 | } |
| 312 | |
| 313 | private flushPeriodic(doTick?: (elapsed: number) => void): number { |
| 314 | if (this._schedulerQueue.length === 0) { |
| 315 | return 0; |
| 316 | } |
| 317 | // Find the last task currently queued in the scheduler queue and tick |
| 318 | // till that time. |
| 319 | const startTime = this._currentTickTime; |
| 320 | const lastTask = this._schedulerQueue[this._schedulerQueue.length - 1]; |
| 321 | this.tick(lastTask.endTime - startTime, doTick); |
| 322 | return this._currentTickTime - startTime; |
| 323 | } |
| 324 | |
| 325 | private flushNonPeriodic(limit: number, doTick?: (elapsed: number) => void): number { |
| 326 | const startTime = this._currentTickTime; |