H
Hans Vlems
Problem description: the program modifies files and the filesystem is
somewhat slow.
More specifically, two subsequent calls on the rename function for one
file fail because the filesystem is slowed down for reasons unknown.
Waiting for one second is sufficient to avoid this effect. My somewhat
crude workaround is a wait function that implements a busy form of
waiting:
starttime=time(NULL);
while (difftime(time(NULL),starttime)<2) // wait 2 seconds
{
... calculates sin() and pow() many times
}
Is there a more elegant way to suspend a program for specific period
of time (accuracy: seconds) ?
The compiler in use is GCC 4.4.4 for Windows (the djgpp distribution
that runs in command line mode).
Hans
somewhat slow.
More specifically, two subsequent calls on the rename function for one
file fail because the filesystem is slowed down for reasons unknown.
Waiting for one second is sufficient to avoid this effect. My somewhat
crude workaround is a wait function that implements a busy form of
waiting:
starttime=time(NULL);
while (difftime(time(NULL),starttime)<2) // wait 2 seconds
{
... calculates sin() and pow() many times
}
Is there a more elegant way to suspend a program for specific period
of time (accuracy: seconds) ?
The compiler in use is GCC 4.4.4 for Windows (the djgpp distribution
that runs in command line mode).
Hans