v1
This commit is contained in:
parent
1d75db5bde
commit
d32989cc81
135 changed files with 17183 additions and 669 deletions
19
node_modules/sleep/sleep_win.cc
generated
vendored
Normal file
19
node_modules/sleep/sleep_win.cc
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include "sleep.h"
|
||||
|
||||
#if ( defined _WIN32 || defined _WIN64 ) && ( !NAN_HAS_CPLUSPLUS_11 )
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
void node_usleep(uint32_t usec) {
|
||||
LARGE_INTEGER li;
|
||||
li.QuadPart = -10LL * usec; // negative values for relative time
|
||||
|
||||
HANDLE timer = CreateWaitableTimer(NULL, TRUE, NULL);
|
||||
if(!timer) return;
|
||||
|
||||
SetWaitableTimer(timer, &li, 0, NULL, NULL, 0);
|
||||
WaitForSingleObject(timer, INFINITE);
|
||||
CloseHandle(timer);
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
Reference in a new issue