/* clock example: countdown */ #include <stdio.h> #include <time.h> #include <iostream> void wait ( int seconds ) { clock_t endwait; endwait = clock () + seconds * CLK_TCK ; while (clock() < endwait) {} } int main () { int n; cout << "Starting countdown..." << endl; for (n=10; n>0; n--) { cout << n << '\n'; wait (1); } cout << "FIRE!!!\n"; return 0; }
Hosted by www.Geocities.ws

1