Uses C++11's sleep_for, which internally uses nanosleep. Signed-off-by: Rosen Penev <rosenp@gmail.com>