replace nanosleep with c++11 function