Skip to content

Instantly share code, notes, and snippets.

@chentsulin
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chentsulin/452d7d0741b62b42965e to your computer and use it in GitHub Desktop.
Save chentsulin/452d7d0741b62b42965e to your computer and use it in GitHub Desktop.
Add Timer Spy on setTimeout and setInterval
var _setT = setTimeout;
setTimeout = function() {
console.log('setTimeout');
console.log(arguments);
_setT.apply(this, arguments);
};
var _setI = setInterval;
setInterval = function() {
console.log('setInterval');
console.log(arguments);
_setI.apply(this, arguments);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment