Can I print more accurate time?

P

poison.summer

Hello

I use the following function to print out the time. But I wonder
whether I can be more accurate
like print out the microsecond

Thanks a lot!
void Print_time()
{
time_t now;
struct tm broken_down_now;
char char_representation_of_now[22];


now = time(0);
broken_down_now = *localtime(&now);
strftime(char_representation_of_now,
sizeof char_representation_of_now,
"%Y-%m-%d %H:%M:%S",
&broken_down_now);
log(fp,"%s\t", char_representation_of_now);
}
 
I

Ian Collins

Hello

I use the following function to print out the time. But I wonder
whether I can be more accurate
like print out the microsecond
Possibly, but it would be implementation dependant.

Try a group for your platform for more details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top