12345678910111213141516171819 |
- #include <iostream>
- #include <ctime> // describes clock() function, clock_t type
- int main()
- {
- using namespace std;
- cout << "Enter the delay time, in seconds: ";
- float secs;
- cin >> secs;
- clock_t delay = secs * CLOCKS_PER_SEC;
- cout << "starting\a\n";
- clock_t start = clock();
- while (clock() - start < delay )
- ;
- cout << "done \a\n";
-
-
- return 0;
- }
|