Opened 13 years ago
Closed 13 years ago
#3345 closed Patches (fixed)
Support for gettimeofday() in high_resolution_timer.
Reported by: | Owned by: | Hartmut Kaiser | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | None |
Version: | Boost Development Trunk | Severity: | Cosmetic |
Keywords: | high_resolution_timer gettimeofday() darwin | Cc: |
Description
On certain platforms, such as OS X (Darwin) util::high_resolution_timer ultimately defaults to using std::clock(). On this platform, and probably many others gettimeofday() is a reasonable, nominally microsecond precision, alternative.
Attached is a version which will make use of gettimeofday() if there are no alternatives and the existence of gettimeofday() is guaranteed by the macro BOOST_HAS_GETTIMEOFDAY.
Attachments (2)
Change History (5)
by , 13 years ago
Attachment: | high_resolution_timer.hpp added |
---|
comment:1 by , 13 years ago
I have just noticed there are some subtle problems with this. I will review them and upload a new version.
comment:2 by , 13 years ago
Thanks! I committed a patched version anyway (I was faster than you :-P). But I'll update it as soon as you found a fix for the problems.
Regards Hartmut
by , 13 years ago
Attachment: | high_resolution_timer.2.hpp added |
---|
Fixed update of the high_precision_timer - differences of unsigned integers are now explicitly mangaged.
A patched version of high_resolution_timer.hpp that includes support for gettimeofday() if it exists in preference to boost::timer().