I would like to use a delay or sleep function in a C program under Windows64 to create a time delay of about 100ms. Which function is recommended? With the following example i always get the warning: implicit declaration of function usleep.
#include <stdio.h>
int main(void)
{
printf("Processing... ");
for(int i=0; i<50; ++i) {
usleep(100000); // 100ms
int position = i%4;
switch(position) {
case 0: printf("\b|"); break;
case 1: printf("\b/"); break;
case 2: printf("\b-"); break;
case 3: printf("\b\\"); break;
}
}
printf("\nDone!");
return 0;
}