Boost logo

Boost :

Subject: Re: [boost] [stopwatches] About reducing the scope of the library
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-09-11 05:17:28


>> My first proposal of Boost.Chrono included Stopwatches, but some on this
>> list sugested that i would be better to split the library :(
>
> That design still has merit, but -
>
>> If no body is agains I will move Boost.Stopwatches to the namespace
>> boost::chrono, remove the reporting facilities, and find a date for a
>> review.
>
> My point was that since you own Chrono you can add whatever you want to
> it. So you could get something distributed now and see about a review
> later.
>
> But perhaps I'm the only one thinking the need for a Boost.Timer
> replacement is urgent.

Nod. Sounds like an important addition to me.

IMO a small addition of a stopwatch could be done without a formal review -
maybe just post the design and get feedback?

But something like:

template <class Clock>
struct stopwatch
{
   void reset();
   double elapsed();
};

would seem hard to go wrong with? OK arguably the result of elapsed()
should be a duration, but that makes it harder to use....

BTW I spotted a typo in your docs:

"The standard defines tree system-wide clocks"
                                 ^^

John.


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