头文件 #include<thread> #include<chrono> 使用 片段如下 std::chrono::time_point<std::chrono::steady_clock> now; while (true) { now = std::chrono::steady_clock::now(); /// do somthing /// expect a cycle of 100ms std::this_thread::sleep_until(now + std::chrono::milliseconds(100)); } 参考 cppreference.com std::this_thread::sleep_until