Skip to content

Instantly share code, notes, and snippets.

@dtinth
Created September 8, 2010 15:26
Show Gist options
  • Save dtinth/570289 to your computer and use it in GitHub Desktop.
Save dtinth/570289 to your computer and use it in GitHub Desktop.
(function() {
var factor = 0.25;
var _Date = Date;
var _setTimeout = setTimeout;
var _setInterval = setInterval;
var start = new _Date().getTime();
Date = function(a,b,c,d,e,f,g) {
if (arguments.length == 0) {
return new _Date(start + (new _Date().getTime() - start) * factor);
}
return _Date(a,b,c,d,e,f,g);
};
setTimeout = function(x, y) {
return _setTimeout.call(window, x, y / factor);
};
setInterval = function(x, y) {
return _setInterval.call(window, x, y / factor);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment