Last active
September 27, 2015 23:54
-
-
Save myconode/45ee6f82a4ef09f6a14f to your computer and use it in GitHub Desktop.
Terminate a Tessel Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Terminate a Tessel Script | |
// Author: Daniel Christopher <[email protected]> | |
// Public Domain | |
// | |
// To stop a script running on the Tessel, simply `return` in the global scope | |
console.log("Hello"); | |
delay(5000); | |
console.log("Goodbye"); | |
// End | |
return; | |
// - lite version of [ErikDubbelboer's sleep](github.com/ErikDubbelboer/node-sleep) | |
function delay(ms){ var e = new Date().getTime() + (ms); while (new Date().getTime() <= e){ ; } ; } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment