How to make delay time in dev c++?
so anyone know how to give delay time in dev c++?
You can use std::difftime function declared in <ctime>
For example
1 2 3
|
std::time_t start = std::time( 0 );
while ( std::difftime( std::time( 0 ), start ) < 1.0 );
|
And if you are on Windows, you can use void Sleep( int Milliseconds )
. You need to #include <Windows.h>
to use it.
Topic archived. No new replies allowed.