void pauses(){ int pause = 1000000000; for(int i=0; i<pause; i++) ;}This function pauses for about seven seconds on my machine. The main advantage of using this approach is that it is very easy to write and to understand. The disadvantage is that you have no explicit control over how long it pauses for. The next function will be much better because you can control how long it pauses for.
#include<ctime> /* or <time.h> for clock() and clock_t */void pauses2(int sec){ clock_t start = clock(); while((float)(clock() - start) / CLOCKS_PER_SEC < sec) ;}
void pauses3(string sec){ string s = "sleep "+sec; system(s.c_str());}◀ Show How Much Time Has Passed▶ Conversion Between String and Number