How does the 25 + 5 clock test script work? I notice that it can make the clock run really fast at times

I notice that it can make the clock run really fast at times

When I look in the repo for the test code, I see the following:

  // We "Hack" the global setTimeout and setInterval functions so time elapses
  // faster (delay is forced to 30ms)
  // The problem is that we still don't know if it's acceptable to use this
  // hack, because it implies forcing the campers to use setTimeout and
  // setInterval functions to measure time in their pomodoro.
  // In cases where hacking does not work, we wait for the timer
  // as much time as is usually required for it.
  const savedSetTimeout = window.setTimeout;
  const savedSetInterval = window.setInterval;

  function hackGlobalTimerFunctions() {
    window.setTimeout = (fun) => {
      return savedSetTimeout(fun, 30);
    };
    window.setInterval = (fun) => {
      return savedSetInterval(fun, 30);
    };
  }

So, they are overriding the global timeout and interval functions and giving them their own versions.

I see, I used the Javascript Date() function. It takes longer, but less lines of code.