This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

flush

Simulates the asynchronous passage of time for the timers in the fakeAsync zone by draining the macrotask queue until it is empty. The returned value is the milliseconds of time that would have been elapsed.

flush(maxTurns?: number): number
      
      flush(maxTurns?: number): number
    

Parameters

maxTurns

Type: number.

Optional. Default is undefined.

Returns

number: The simulated time elapsed, in millis.