Saturday 15 April 2017

Node.js call a function after n seconds of script runtime

I have a script in node.js and I want to call my end() function n seconds after the start of another function (or the start of the script). So I tried using setTimeout(function() {this.end()}, n); for this, but setTimeout just acts as a sleep, which is bad and not what I wanted to achieve.



via kevin

No comments:

Post a Comment