#ifndef MY_SLEEP_H #define MY_SLEEP_H #include #include #include #include #include #include #include /*! Utility function to have a sleep function with better resolution and which only stops one thread. */ static void my_sleep(double sleeptime){ struct timeval tv; struct timezone tzp; double start; double real; if(gettimeofday(&tv,&tzp)!=0) { perror("get_time: "); exit(-1); } start = (double)tv.tv_sec + ((double)tv.tv_usec/1000000.0); real=start; while( (real-start)