Prior to C++11, C++ had no thread concept and no sleep capability, so your solution was necessarily ...
stackoverflow.com