Make use of std::thread and std::chrono for cross platform compatibility