Boost logo

Boost :

From: Philippe Vaucher (philippe.vaucher_at_[hidden])
Date: 2007-01-03 14:33:38


Hello guys,

First of all, happy new year ! :)

I thought it would be time for a little update.

I structured the whole a bit, and now there are 8 different timers :

Portable :

   - typedef timer<microsec_device> microsec_timer; //
   boost::bla::microsec_clock
   - typedef timer<second_device> second_timer; //
   boost::bla::second_clock
   - typedef timer<clock_device> clock_timer; //
   std::clock()

Windows:

   - typedef timer<qpc_device> qpc_timer; //
   QueryPerformanceCounter()
   - typedef timer<tgt_device> tgt_timer; //
   timeGetTime()
   - typedef timer<gstaft_device> gstaft_timer; //
   GetSystemTimeAsFileTime()
   - typedef timer<gtc_device> gtc_timer; //
   GetTickCount()

POSIX:

   - typedef timer<gtod_device> gtod_timer; // gettimeofday()
   device

I created a tree like this at the moment :

boost/timer.hpp
boost/timer/devices.hpp
boost/timer/implementation.hpp
boost/timer/typedefs.hpp
boost/timer/devices/clock.hpp
boost/timer/devices/date_time.hpp
boost/timer/devices/GetSystemTimeAsFileTime.hpp
boost/timer/devices/GetTickCount.hpp
boost/timer/devices/gettimeofday.hpp
boost/timer/devices/QueryPerformanceCounter.hpp
boost/timer/devices/timeGetTime.hpp

And this brought me to some questions :

What do you guys think about the structure ? Should we pollute the boost
namespace ? Should I create a "timer" namespace inside the boost one ?
should I create a "devices" namespace inside the timer one ?

I also have another question, can someone point me to another POSIX/linux
timing api beside gettimeofday ?

Also, at start I wanted to provide some way to get the overhead/resolution
of each devices from within the code, but then I removed it because I
realized it's more trouble than it's worth, not to mention it probably won't
be used. I decided to describe the overhead, resolution, pros/cons and
issues in each device's header and in the incoming documentation instead.

Thank you,
Philippe

p.s: win32 apis like GetProcessTimes() or GetThreadTimes() weren't supported
because there isn't much benefit from having them and they don't exist on
win9x. Tell me if you think I'd add them anyway.




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