I use borland. For a while now I've been working on using the sleep functions... none of them work... can anyone give me a working sleep function (that doesn't use the processer ticks... or whatever ya might call it)?
Printable View
I use borland. For a while now I've been working on using the sleep functions... none of them work... can anyone give me a working sleep function (that doesn't use the processer ticks... or whatever ya might call it)?
i used this in bcc55, is it the same thing as sleep
where 'bouts ny are you from?Code:#include <iostream.h>
#include <time.h>
int f_wait (int);
main()
{
f_wait (4);
cout<<"hello";//notes
return(0);
}
int f_wait(int SecondsToWait)
{
time_t TheTime = time(NULL);
while(time(NULL) - TheTime < SecondsToWait);
return 1;
}
Look at the man page for 'setitimer'
If it's a newer version of borland, it should have Sleep().
#include <windows.h>
.
.
Sleep(1000); //Sleep 1 second