Reschedulable setInterval for node.js.
var reInterval = ;var inter =;// This will reset/reschedule the interval after 3 seconds, therefore// the interval callback won't be called for at least 13 seconds.;
reInterval(callback, interval[, param1, param2, ...])
This is exactly like setInterval.
callback: The callback to be executed repeatedly.
interval: The number of milliseconds (thousandths of a second) that the
reInterval()function should wait before each call to
param1, param2, ...: (OPTIONAL) These arguments are passed to the
interval object with the following methods:
This function resets the
interval and restarts it now.
interval: (OPTIONAL) This argument can be used to change the amount of milliseconds to wait before each call to the
callbackpassed to the
This function clears the interval. Can be used to temporarily clear the
interval, which can be rescheduled at a later time.
This function clears the interval, and will also clear the
params passed to reInterval, so calling this essentially just makes this object ready for overwriting with a new
Please ensure that either the
interval.destroy() function is called before overwriting the
interval object, because the internal
interval can continue to run in the background unless cleared.