[src]#include < time.h >
#include < iostream.h >
void sleep( clock_t wait )
{
clock_t goal;
goal = wait + clock();
while( goal > clock() );
}
void main()
{
sleep(5000);
cout<<"hello";
}
[/src]
Note: this code implemented in vc++ 6.0
[src]#include < time.h >
#include < iostream.h >
void sleep( clock_t wait )
{
clock_t goal;
goal = wait + clock();
while( goal > clock() );
}
void main()
{
sleep(5000);
cout<<"hello";
}
[/src]
Note: this code implemented in vc++ 6.0
This one would helpful also.
[src]
#include < iostream.h >
#include < windows.h >
void main()
{
cout<<"test";
::Sleep(1000);
cout<<"test2";
}
[/src]
The ::Sleep() function in not a delay function for everything. It is only to suspend the execution of the current thread for a specified interval.
In other words the time in this function is controlled by the current thread priority.
Actions : (View-Readers)
There are no names to display.