add a timer c++

C++
# include <windows.h>
# include <iostream>
using namespace std;

void timer(int sec)
{
    Sleep(sec*1000);
}

int main()
{
    cout << "Wait 5 seconds " << endl;
    timer(5);
    cout << "FireWorks !" << endl;

    return 0;
}
Source

Also in C++: