Hi
I have been trying very hard, but I can't seem to get Pelles C to give me the time in milliseconds, in a for loop. I need to have the program print the time in milliseconds. The included code will work and print the milliseconds, but they are all the same number or all but one is a different number. How can I get this program to give me a broader range? I want to use the milliseconds as a seed for srand. But I need to make the seeds very different.
Thanks,
Mike
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/timeb.h>
int main ()
{
int t;
struct _timeb now;
_ftime(&now);
for ( t = 0; t < 10; t+=1 )
{
_ftime(&now);
printf (" time = < %12u >", now.time );
printf (" milliseconds = < %6d >\n", now.millitm );
}
return 0;
}