I am looking for a way to run some code in nodejs in N seconds.
Tried setTimeout (), but it seems to completely block it until the time runs out, but this is not what I want, since my server is still sending and receiving events.
Any tips?
Actually, it setTimeoutis asynchronous, so it will not block.
setTimeout
setTimeout(function(){ // this code will only run when time has ellapsed }, n * 1000); // this code will not block, and will only run at the time
Source: https://habr.com/ru/post/1547508/More articles:Can't determine the error in calculating the matrix? - matrixРазличия между двумя таблицами в Lua - optimizationMatrix Transforms OpenTK - matrixCapturing global keyboard events on Linux using NodeJS - linuxAndroid Gradle Build ExceptionReleaseResources source package in Android library - androidОшибка Swift/IOS8: "фатальная ошибка: невозможно развернуть Необязательный. - ios8How to set the value of a specific cell using xlsx (R package)? - r400 Ошибка при вызове AJAX в Twitter - javascriptКак получить аннотацию типа поля в обработке аннотации Java? - javaWKWebView (OSX 10.10) will not load Google mobile sites - objective-cAll Articles