diff options
Diffstat (limited to 'test/tsan/process_sleep.h')
-rw-r--r-- | test/tsan/process_sleep.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/tsan/process_sleep.h b/test/tsan/process_sleep.h new file mode 100644 index 000000000000..5938a42bf8b2 --- /dev/null +++ b/test/tsan/process_sleep.h @@ -0,0 +1,7 @@ +#include <time.h> + +static void process_sleep(int sec) { + clock_t beg = clock(); + while((clock() - beg) / CLOCKS_PER_SEC < sec) + usleep(100); +} |