One, the most low timer: Each execution interval of 5s, and then continue to execute
(function Schedule () { schedule);} ()); function Do_it (callback) { varnew Date (); Console.log (Times.getseconds ()); Callback ();};
Second, forcing a bit taller use plug-in Node-schedule
Installation: NPM Install Node-schedule
1, determine the time, for example: November 21, 2012, 5:30
var schedule = require (' Node-schedule '); var New Date (5, 0); var function () { console.log (' The world was going to end today. ') );}); J.cancel (); // Cancel a preset schedule
2. Fixed minutes per hour, for example: 42 minutes per hour
var schedule = require (' Node-schedule '); var New = $ var function () {console.log (' The answer to life, the universe, and everything! ' );});
3. Some of the days of one weeks, for example: every Thursday, Friday, Saturday, 17 in Sunday
var New New schedule. Range (4, 6= n= 0; var function () { console.log (' Today is recognized by Rebecca black! ' );});
4, execution per second
var New schedule. Recurrencerule (); var times = []; for (var i=1; i<60; i++= times ; var c=0; varfunction() { C+ +; Console.log (c); });
Nodejs Timer timed execution function