|
Boost Users : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2005-01-22 11:43:53
On Thu, 20 Jan 2005 03:22:01 -0500, Donato Petrino wrote
> Hello,
>
> 2 questions regarding the microsec_clock:
>
> - Why it just have 'local_time()' but not 'universal_time()' member?
Hmm, unsure what happened there -- I have a feeling that I was thrown off by
gettimeofday not supporting adjustment on some platforms, but it doesn't
matter why ultimately. It's easy to add this....
> (Analogous to the second_clock. I know that it can be converted to
> UTC, but its inefficient and I have to know in which time zone the
> program runs.)
Yes, you are right, the client should need to do this. I've checked in an
extension and test to the micro second clock for POSIX platforms that adds the
universal_time call. We should have changes for windows in a few days at the
most.
Note that in the next release you will also be able to pass a time_zone
specifier and return a locally adjusted time. This is the case where you want
to get the current time in New York (just to pick one) even if the computer
time isn't set for that timezone.
> - For what reason "::std::time(&t)" in "microsec_time_clock.hpp:58"
> is called? gettimeofday()'s "tv->tv_sec" already has the sec's
> since 1.1.1970, so there is no need for this extra call. Is it a bug?
You are indeed correct that there was an extra call there -- it's removed now.
Thanks!
Jeff
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net