Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <chrono>
- #include <thread>
- using std::cout;
- void f() {
- std::chrono::seconds sleep_time(1);
- while (1) {
- cout << "rendering...\n";
- std::this_thread::sleep_for(sleep_time);
- }
- }
- int main() {
- cout << "1\n";
- cout << "2\n";
- std::thread t(f);
- cout << "3\n";
- cout << "4\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement