I want to get the system time including fractional part of the seconds. Is it possible in standard c (ANSI C)? If not then tell me some libraries for window OS so that I make it possible. In Linux I have the following code with work fine for me.
#include <sys/time.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
char buffer[30];
struct timeval tv;
time_t curtime;
gettimeofday(&tv, NULL);
curtime=tv.tv_sec;
strftime(buffer,30,"%m-%d-%Y %T.",localtime(&curtime));
printf("%s%ld\n",buffer,tv.tv_usec);
return 0;
}
Output is
12-25-2009 11:09:18.35443541
Kindly help me, how is it possible for window OS. IF ANSI C doesn't allow me.