Game Loop - Revisited (2)

Code:


  function tick(timeValue,timeStamp) {
      // Initialization
      if(oldTick == 0) oldTick = v;
      while (oldTick < timeValue) {
          // Increment with 1/20th of a second
          oldTick = oldTick + 0.05;
          // And update the world-state
          update();
      }
  }