Skip to content

Instantly share code, notes, and snippets.

@myconode
Last active September 27, 2015 23:54
Show Gist options
  • Save myconode/45ee6f82a4ef09f6a14f to your computer and use it in GitHub Desktop.
Save myconode/45ee6f82a4ef09f6a14f to your computer and use it in GitHub Desktop.
Terminate a Tessel Script
// Terminate a Tessel Script
// Author: Daniel Christopher <thelostspore@gmail.com>
// 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