1// this_thread::sleep_for example
2#include <iostream> // std::cout, std::endl
3#include <thread> // std::this_thread::sleep_for
4#include <chrono> // std::chrono::seconds
5
6int main()
7{
8 std::cout << "countdown:\n";
9 for (int i=10; i>0; --i) {
10 std::cout << i << std::endl;
11 std::this_thread::sleep_for (std::chrono::seconds(1));
12 }
13 std::cout << "Lift off!\n";
14
15 return 0;
16}