By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,731 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,731 IT Pros & Developers. It's quick & easy.

Can I print more accurate time?

P: n/a
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);
}

Feb 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
po***********@gmail.com wrote:
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.

--
Ian Collins.
Feb 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.