#include <iostream>
#include <thread>
#include <chrono>
// Function to be executed
void myFunction() {
std::cout << "Function executed after 5 seconds!" << std::endl;
}
int main() {
std::cout << "Waiting for 5 seconds..." << std::endl;
// Pause the thread for 30 seconds
std::this_thread::sleep_for(std::chrono::seconds(5));
// Execute the function
myFunction();
}
/*
run:
Waiting for 5 seconds...
Function executed after 5 seconds!
*/