time ?
how do can I make so that the program waits a couple of milliseckonds then continue what it was doing?
I think this will work(ran under MS VC++)
[edited by - nobodynews on November 25, 2002 12:27:14 PM]
#include <iostream>using namespace std;#include <ctime>int main(void){ clock_t start_time, time_to_wait; cout << "Enter the number of milliseconds you wish to wait: "; cin >> time_to_wait; start_time = clock(); // this is important part of the waiting while((clock() - start_time) <= time_to_wait) { } cout << "All done!\n"; return 0;}
[edited by - nobodynews on November 25, 2002 12:27:14 PM]
C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement