In javascript, there is no such thing as a sleep timer. This is not a nocturnal alarm clock, but a programming function that will stop the code from running for the time set in it. Since javascript doesn’t provide this you have to use setTimeout or this method to create a sleep timer.

This code was written by Marcel of http://www.nodebeginner.org/ He’s a smart guy and I recommend you buy his book on node if you want some great info on node (not to mention the excellent tutorial on the same site. Here is the code:

Current Song

Comments are closed.