1#include <chrono>
2#include <thread>
3
4std::this_thread::sleep_for(std::chrono::milliseconds(x));
1// to use sleep function on windows with c++
2#include <Windows.h>
3Sleep(3000) // based on milliseconds
1#include <time.h>
2
3int main(int argc, char const *argv[])
4{
5 sleep(10); // wait for 10s
6
7 return 0;
8}