hanchenye-llvm-project/compiler-rt/test/tsan/process_sleep.h

8 lines
148 B
C

#include <time.h>
static void process_sleep(int sec) {
clock_t beg = clock();
while((clock() - beg) / CLOCKS_PER_SEC < sec)
usleep(100);
}