I'd like to do a proggy that will count to - for example - 100 in one seconds interval... and execute some code in every second... any ideas???
I'd like to do a proggy that will count to - for example - 100 in one seconds interval... and execute some code in every second... any ideas???
time.h
clock()
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
or you could use Sleep()
Sleep is an Win32 API command; it's simple and gets the job done.Code:#include <windows.h> ... for (int i = 0; i < 100; i++) { some code Sleep(1000) // pause for 1 second (1000 milliseconds) }
Last edited by d00b; 07-31-2002 at 03:22 PM.
thank you both guys, especially for d00b !!