I want to print time in the format hh:mm:ss:ms(milliseconds). I could print in the form of hh:mm:ss. What can be the way to print remaining milliseconds?
This is what I use in linux ...
struct timeval tv;
gettimeofday(&tv,0);
time_t long_time;
struct tm *newtime;
time(&long_time);
newtime = localtime(&long_time);
char result[100] = {0};
sprintf(result, "%02d:%02d:%02d.%03ld", newtime->tm_hour,newtime->tm_min,newtime->tm_sec, (long)tv.tv_usec / 1000);
return result;
I have no experience working in windows .. try to find similar calls ..