Last active
November 1, 2021 08:18
-
-
Save weiancheng/37a0e632e2802cc6640112bc74f350bd to your computer and use it in GitHub Desktop.
delay for seconds
delay for milliseconds
delay for nanoseconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// using standard library | |
#include <chrono> | |
#include <thread> | |
std::this_thread::sleep_for(std::chrono::seconds(10)); // delay for 10s | |
std::this_thread::sleep_for(std::chrono::milliseconds(10)); // delay for 10ms | |
std::this_thread::sleep_for(std::chrono::nanoseconds(10)); // delay for 10ns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment