Boost logo

Boost :

Subject: Re: [boost] [stopwatches] About reducing the scope of the library
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-09-11 13:26:45


Le 11/09/11 11:17, John Maddock a écrit :
>>> 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?
>
I would prefer a review.
> 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....
>
Why do you think it is harder to use? Could you give an example when
returning double will be clearer? Which will be the units of this double?

> BTW I spotted a typo in your docs:
>
> "The standard defines tree system-wide clocks"
> ^^
>
Thanks,
Vicente


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