Shamoon
Shamoon

Reputation: 43501

Why does `setTimeout` not recur in Node.js?

var arrayProcessTimeout;
arrayProcessTimeout = setTimeout(function() {
  console.log('hard');
  return null;
}, 50);

That's my code in Node.js and one would expect it to output hard constantly.. but it doesn't. It outputs it once and that's it.

Upvotes: 1

Views: 593

Answers (1)

gion_13
gion_13

Reputation: 41533

Maybe you want to use setInterval instead of setTimeout.

Upvotes: 8

Related Questions