example code using clock_nanosleep