Boost logo

Boost Users :

Subject: Re: [Boost-users] [timer] Examples do not compile
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-04-16 13:46:43


On Tue, Apr 16, 2013 at 12:42 PM, Michael Powell <mwpowellhtx_at_[hidden]>wrote:

> Hello,
>
> I am trying to setup a "simple" elapsed timer abstraction to hide the
> boost::timer::cpu_timer concern.
>
> However, I am finding that the usage example illustrated here does not
> compile, or I am not including something I need to include (more likely).
>
>
> http://www.boost.org/doc/libs/1_53_0/libs/timer/doc/cpu_timers.html#using-cpu_timer
>

//Apparently something like this works with my toolchain. Not sure about
the illustration. Probably a language standards difference.
elapsed_timer::nanosecond_type const elapsed_timer::elapsed() {

    //The auto type exposes system and user. Not sure why.
    auto elapsed_times = m_timer.elapsed();
    //Result elapsed time is system plus user.
    return elapsed_times.system + elapsed_times.user;
}

FWIW, I am building with Sourcery CodeBench which I believe is GCC 4.7.2
toolchain.

> Might there be more complete working examples I can draw from?
>
> Thank you...
>
> Regards,
>
> Michael Powell
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net