overte/examples/timer.js
2014-02-03 10:10:58 -08:00

8 lines
No EOL
340 B
JavaScript

var one_timer = Script.setTimeout(function() { print("One time timer fired!"); }, 10000);
var multiple_timer = Script.setInterval(function() { print("Repeating timer fired!"); }, 1000);
// this would stop a scheduled single shot timer
Script.clearTimeout(one_timer);
// this stops the repeating timer
Script.clearInterval(multiple_timer);