Use nanosleep with timer.