Boost logo

Boost :

Subject: Re: [boost] [date_time] monotonic_time() proposal
From: Dmitry Goncharov (dgoncharov_at_[hidden])
Date: 2010-02-28 14:22:56

Andrey Semashev wrote:
> On 02/27/2010 11:52 AM, Dmitry Goncharov wrote:
> Why not introduce monotonic_clock? With a configuration macro to
> detect its absence.
There is no need for an additional class.

microsec_clock and second_clock have the following interface (simplified)

template<typename time_type>
class microsec_clock { // or class second_clock.
    static time_type local_time() ;
    static time_type universal_time() ;
    template<typename time_zone_type>
    static time_type local_time(shared_ptr< time_zone_type >) ;

static time_type monotinoc_time() is obviously missing.

pt::ptime now = microsec_clock::monotonic_time(); // monotonic time with
usec resolution
pt::ptime now2 = microsec_clock::universal_time(); // universal time
with usec resolution
pt::ptime now3 = second_clock::monotonic_time(); // monotonic time with
sec resolution

BR, Dmitry

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