Advertisement
Guest User

lewl

a guest
Oct 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var time = new Date().getTime() + 10000 //10 seconds
  2.  
  3. var tID = setInterval(function(callback){
  4.     if(new Date().getTime() >= time){
  5.         clearInterval(tID);
  6.         return callback();
  7.     }
  8. }, function(){
  9.     console.log('Time is up!!!!!');
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement