R&Y: Added DAY RTA Tapp Card and Additional BKK BEM Stored Value Card AIDs to `aid_de...
[RRG-proxmark3.git] / tools / deprecated-hid-flasher / flasher / sleep.h
blobffb5486aa48e7c16d2a03c23c9eab083ffb36e17
1 //-----------------------------------------------------------------------------
2 // platform-independant sleep macros
3 //-----------------------------------------------------------------------------
5 #ifndef SLEEP_H__
6 #define SLEEP_H__
8 #ifdef _WIN32
9 #include <windows.h>
10 #define msleep(n) Sleep(n)
11 #else
12 #include <time.h>
13 #include <errno.h>
14 static void nsleep(uint64_t n) {
15 struct timespec timeout;
16 timeout.tv_sec = n / 1000000000;
17 timeout.tv_nsec = n % 1000000000;
18 while (nanosleep(&timeout, &timeout) && errno == EINTR);
20 #define msleep(n) nsleep(1000000 * (uint64_t)n)
21 #endif
23 #endif