Check out example codes for "add a timer c++". It will help you in understanding the concepts better.

Code Example 1

# 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;
}

Learn ReactJs, React Native from akashmittal.com