void operator()(Stopwatch & stopwatch_ //, system::error_code & ec = BOOST_CHRONO_THROWS ) { typedef typename Stopwatch::laps_collector::storage_type laps_collector_acc; laps_collector_acc const& acc = stopwatch_.get_laps_collector().accumulator_set(); typedef typename Stopwatch::duration duration_t; this->os_ << static_cast<format_type&> (*this) % boost::accumulators::count(acc) % io::group(std::fixed, std::setprecision(this->precision_), duration_fmt(this->duration_style_), (boost::accumulators::count(acc) == 0) ? boost::chrono::duration<double, Ratio>(duration_t::zero()) : boost::chrono::duration< double, Ratio>(duration_t(boost::accumulators::sum(acc)))) % io::group(std::fixed, std::setprecision(this->precision_), duration_fmt(this->duration_style_), (boost::accumulators::count(acc) == 0) ? boost::chrono::duration<double, Ratio>(duration_t::zero()) : boost::chrono::duration< double, Ratio>(duration_t((boost::accumulators::min)(acc)))) % io::group(std::fixed, std::setprecision(this->precision_), duration_fmt(this->duration_style_), (boost::accumulators::count(acc) == 0) ? boost::chrono::duration<double, Ratio>(duration_t::zero()) : boost::chrono::duration< double, Ratio>(duration_t((boost::accumulators::max)(acc)))) % io::group(std::fixed, std::setprecision(this->precision_), duration_fmt(this->duration_style_), ((boost::accumulators::count(acc) > 0) ? boost::chrono::duration<double, Ratio>(duration_t(boost::accumulators::sum(acc) / boost::accumulators::count(acc))) : boost::chrono::duration< double, Ratio>(duration_t::zero()))); }
void operator()(Stopwatch & stopwatch_ //, system::error_code & ec= BOOST_CHRONO_THROWS ) { typedef typename Stopwatch::duration duration_t; duration_t d = stopwatch_.elapsed(); //duration_t d = stopwatch_.elapsed(ec); if (d < duration_t::zero()) return; duration_style_io_saver dsios(this->os_); this->os_ << static_cast<format_type&>(*this) % io::group(std::fixed, std::setprecision(this->precision_), duration_fmt(this->duration_style_), boost::chrono::duration< double, Ratio>(d)) ; }