Skip to content

Instantly share code, notes, and snippets.

@anotherjesse
Created August 25, 2009 22:37
Show Gist options
  • Select an option

  • Save anotherjesse/175091 to your computer and use it in GitHub Desktop.

Select an option

Save anotherjesse/175091 to your computer and use it in GitHub Desktop.
function setTimeout(callback, ms) {
var _timer = Cc['@mozilla.org/timer;1']
.createInstance(Ci.nsITimer);
_timer.initWithCallback({notify: callback}, ms, Ci.nsITimer.TYPE_ONE_SHOT);
return _timer;
}
function clearTimeout(timer) {
timer.cancel();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment