Boost logo

Boost :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2006-05-22 02:56:43


Silex wrote:
> Hello,
>
> As I didn't receive the answers I was looking for, here is my last
> proposal.
>

[snip]

>
> Because of the long discussion about QueryPerformanceCounter that
> didn't came to a real conclusion, I decided to implement two
> additionnal timers:
>
> - boost::qpc_timer, which use QueryPerformanceCounter() for its
> resolution.
> - boost::tgt_timer, which use timeGetTime() for its resolution.
>
> As using those timers would make no sense on another platform than
> windows, those are not defined by default. One must #define
> BOOST_QPC_TIMER to get boost::qpc_timer and must #define
> BOOST_TGT_TIMER to get boost::tgt_timer.

I've always found it really awkward having to define global macros to get
features. Why not simply:

(in "main" timer include file)
-------
#if defined (BOOST_WINDOWS)
# include <boost/.../qpc_timer.hpp>
# include <boost/.../tgt_timer.hpp>
#endif
-------
and/or

(in specific implementations - qpc/time_get_time_timer)
-------
#if defined (BOOST_WINDOWS)

namespace boost {
class <windows_specific_timer>
{ ... };
}

#endif // BOOST_WINDOWS
-------

// Johan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk