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.


> 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>

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

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


// Johan

Boost list run by bdawes at, gregod at, cpdaniel at, john at