Use nanosleep() in faked sleep() and usleep() to avoid rounding issues