Answers for "add a timer c++"

C++
3

add a timer 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;
}
Posted by: Guest on February-08-2020

Browse Popular Code Answers by Language