I ve been told for a sleep function but i can't find any info about it....Any thoughts on how i should implement this method?
If you are using Linux, then this for sleep and if you are using windows then this .
also is there any way to read the system time through c++?{to know what time appears in the system clock} Yes there is, use the header file#include if using C++ or #include if using C. For the header reference see here and here .
thanks in advance for your help....Nicolas
Glad we could help.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
No need to complicate matters, here is a simple way of using the function..
#include <iostream>
#include <windows.h>
using namespace std;
int main(int argc, char** argv)
{
cout << "Hello" << endl ;
cout << "Wait for 3 seconds..." << endl ;
Sleep(5000) ; // takes the time in milliseconds ( 1 second = 1000 milliseconds)
cout << "World" ;
getchar( ) ;
return 0 ;
}
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734