Labels

Sunday, November 4, 2018

Delay the program some time with C++

#include <chrono> 
#include <thread> 

int main(){
using namespace std::this_thread; /*sleep_for, sleep_until */
using namespace std::chrono; /* nanoseconds, system_clock, seconds */
sleep_for(nanoseconds(10)); 
//sleep_until(system_clock::now() + seconds(1)); 
}  
REFERENCE:
https://stackoverflow.com/questions/158585/how-do-you-add-a-timed-delay-to-a-c-program

No comments:

Post a Comment