using sleep_for
// thread::get_id / this_thread::get_id
#include <iostream> // std::cout
#include <thread> // std::thread, std::thread::id, std::this_thread::get_id
#include <chrono> // std::chrono::seconds
using namespace std;
void show(int n) {
if (n==5){
cout<<"start n=5"<<endl;
this_thread::sleep_for(chrono::seconds(5));
cout<<"sleep_for(chrono::seconds(5)) end"<<endl;
}
else{
cout<<"This is not 5"<<endl;
}
}
int main()
{
thread t(show,5);
thread t1(show,100);
t.join();
t1.join();
}