Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ run loop for 5 seconds

#include <iostream>
#include <windows.h>
using namespace std;
int main(){

	for (int i = 0; i < 5; i++) {
		cout << i << endl;
		Sleep(1000); // sleep for 1 second(1000 milliseconds)
	}
}

 
PREVIOUS NEXT
Tagged: #run #loop #seconds
ADD COMMENT
Topic
Name
4+7 =