Skip to content

Instantly share code, notes, and snippets.

@gyakkun
Created May 6, 2022 03:07
Show Gist options
  • Save gyakkun/d017f7730cd0c9d215f66a02cbb2cb56 to your computer and use it in GitHub Desktop.
Save gyakkun/d017f7730cd0c9d215f66a02cbb2cb56 to your computer and use it in GitHub Desktop.
sp test
var {spawn} = require("child_process")
var newHttpServer = spawn("httpserver")
function sleep(){
return new Promise(resolve => setTimeout(resolve,5000))
}
var ctr = 0
async function main(){
while(true){
console.log("looping " + ctr++)
await sleep()
}
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment