Reputation: 10005
On a sftp server i create a "lockfile.lock" if another application is manipulating data. No in my c application i would like to check if the lockfile.lock exists and than "WAIT 5 SECONDS".
How do i wait 5 seconds in c without blasting the CPU to 100%?
Thanks
Upvotes: 0
Views: 244
Reputation: 1507
On windows and linux there is a system call "sleep()". Windows, Linux
Upvotes: 1
Reputation: 96266
#include <unistd.h>
unsigned int sleep(unsigned int seconds);
DESCRIPTION
sleep() makes the calling process sleep until seconds seconds
have elapsed or a signal arrives which is not ignored.
Upvotes: 1