Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- #include <string>
- #include <windows.h>
- bool taskPassed = false;
- static void message()
- {
- Sleep(5000);
- std::cout << "\nThanks for waiting\n" << std::endl;
- taskPassed = true;
- }
- int main()
- {
- std::thread th(message);
- while (!taskPassed)
- {
- Sleep(500);
- std::cout << ". ";
- }
- th.join();
- std::cout << "\b\b\b";
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement