src/eventloop.js
function ontick(next) {
      // No point in waiting that long
      if (next >= timeoutOn) {
        timeout();
        return;
      }

      const activeWindow = eventLoop.active;
      if (completionFunction && activeWindow.document.documentElement)
        try {
          const waitFor   = Math.max(next - Date.now(), 0);
          // Event processed, are we ready to complete?
          const completed = completionFunction(activeWindow, waitFor);
          if (completed)
            done();
        } catch (error) {
          done(error);
        }

    }
function ontick(next) {
      // No point in waiting that long
      if (next >= timeoutOn) {
        timeout();
        return;
      }

      const activeWindow = eventLoop.active;
      if (completionFunction && activeWindow.document.documentElement)
        try {
          const waitFor   = Math.max(next - Date.now(), 0);
          // Event processed, are we ready to complete?
          const completed = completionFunction(activeWindow, waitFor);
          if (completed)
            done();
        } catch (error) {
          done(error);
        }

    }
function ontick ( next ) { // No point in waiting that long if ( next >= timeoutOn ) { timeout ( ) ; return ; } const activeWindow = eventLoop . active ; if ( completionFunction && activeWindow . document . documentElement ) try { const waitFor = Math . max ( next - Date . now ( ) , 0 ) ; // Event processed, are we ready to complete? const completed = completionFunction ( activeWindow , waitFor ) ; if ( completed ) done ( ) ; } catch ( error ) { done ( error ) ; } }
Fired after every event, decide if we want to stop waiting
Fired after every event decide if we want to stop waiting