OK - you guys messing with me?
Here is what I get -
Time: Sun Dec 13 14:03:30 2020
Time: Sun Dec 13 14:03:30 2020
Press any key to continue...
Windows 10 - Pelles 9.00.9 although also on version 10 (which I'll retry - different computer)
I even used
your posted code and pasted into a new project....
I have something corrupted?
I'll do the reboot but I do that every day
if you have a moment could you test this minor mod?
#include <threads.h>
//#include <time.h>
#include <stdio.h>
int main(void)
{ int ans;
printf("Time: %s", ctime(&(time_t){time(NULL)}));
ans = thrd_sleep(&(struct timespec){.tv_sec=15}, NULL); // sleep x sec
if (ans < 0)
{ puts("error returned");}
printf("Time: %s", ctime(&(time_t){time(NULL)}));
return 0;
}
I get an error with .tv_sec > .1 as in:
Time: Sun Dec 13 14:15:25 2020
error returnedTime: Sun Dec 13 14:15:25 2020
Press any key to continue...
Thanks for the help,
John Z
argggg - Worked fine on Windows 10 with Pelles 10.00.6 this time
Thank you all, need to see what is going on with this laptop ;( spent several hours trying to
figure out a code issue that's not a code issue......at least it is the weekend.