diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2020-04-25 20:04:51 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2020-04-25 20:04:51 +0200 |
commit | f37c2cd7e83c8e40576256d88ecc6b6f96dd72ee (patch) | |
tree | 39048632452ed8fb051432131bec25773b2db888 /src/global.h | |
parent | e94279eecbfdd1988912ac7ce24e6d4d702695a1 (diff) | |
download | 0xFFFF-f37c2cd7e83c8e40576256d88ecc6b6f96dd72ee.tar.bz2 |
all: Fix delays for all operations
Diffstat (limited to 'src/global.h')
-rw-r--r-- | src/global.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/global.h b/src/global.h index a26c88b..ab4b24d 100644 --- a/src/global.h +++ b/src/global.h @@ -22,7 +22,7 @@ extern int verbose; #define ALLOC_ERROR() do { ERROR("Cannot allocate memory"); } while (0) #define ALLOC_ERROR_RETURN(...) do { ALLOC_ERROR(); return __VA_ARGS__; } while (0) -#define SLEEP(usec) do { struct timespec _t = { 0, (usec) }; nanosleep(&_t, NULL); } while (0) +#define MSLEEP(msec) do { nanosleep(&(struct timespec){ (msec / 1000), (1000L * 1000L * (msec % 1000)) }, NULL); } while (0) static inline void * MEMMEM(void *haystack, size_t haystacklen, const void *needle, size_t needlelen) { for ( size_t i = 0; i < haystacklen; ++i ) { |