Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created June 5, 2018 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugmodedotnet/dfec3968ef05c3e0f8a80d7bf7c519b7 to your computer and use it in GitHub Desktop.
Save debugmodedotnet/dfec3968ef05c3e0f8a80d7bf7c519b7 to your computer and use it in GitHub Desktop.
function startTimer() {
timerId = setInterval(() => {
if (!sockets.size) {
clearInterval(timerId);
timerId = null;
console.log(`Timer stopped`);
}
updateData();
for (const s of sockets) {
s.emit('data', { data: localdata });
}
}, 10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment