|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74343 - in sandbox/stopwatches: . boost boost/chrono boost/chrono/stopwatches boost/chrono/stopwatches/detail libs libs/chrono libs/chrono/stopwatches libs/chrono/stopwatches/doc libs/chrono/stopwatches/doc/html libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches libs/chrono/stopwatches/doc/html/images libs/chrono/stopwatches/example libs/chrono/stopwatches/perf libs/chrono/stopwatches/test
From: vicente.botet_at_[hidden]
Date: 2011-09-11 08:44:04
Author: viboes
Date: 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
New Revision: 74343
URL: http://svn.boost.org/trac/boost/changeset/74343
Log:
Stopwatches: Reinsertion on Boost.Chrono
Added:
sandbox/stopwatches/
sandbox/stopwatches/boost/
sandbox/stopwatches/boost/chrono/
sandbox/stopwatches/boost/chrono/stopwatches/
sandbox/stopwatches/boost/chrono/stopwatches.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/config.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/detail/
sandbox/stopwatches/boost/chrono/stopwatches/detail/adaptive_string.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/detail/default_out.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/detail/static_assert.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp (contents, props changed)
sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp (contents, props changed)
sandbox/stopwatches/libs/
sandbox/stopwatches/libs/chrono/
sandbox/stopwatches/libs/chrono/stopwatches/
sandbox/stopwatches/libs/chrono/stopwatches/Jamroot.jam (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/boost-build.jam (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/
sandbox/stopwatches/libs/chrono/stopwatches/doc/Jamfile.v2 (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/appendices.html (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/overview.html (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/reference.html (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/users_guide.html (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boostbook.css (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/alert.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/blank.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/caution.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/draft.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/home.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/important.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/next.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/next_disabled.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/note.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/prev.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/prev_disabled.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/smiley.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/tip.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/toc-blank.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/toc-minus.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/toc-plus.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/up.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/up_disabled.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/warning.png (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/index.html (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/html/standalone_HTML.manifest (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/index.html (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/doc/stopwatches.qbk (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/
sandbox/stopwatches/libs/chrono/stopwatches/example/loop_stopclock_accumulator_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/nested_stopclock_accumulator_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopclock_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/sleep_for.hpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/specific_stopwatch_accumulator_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/stopclock_accumulator_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/stopclock_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/suspendible_stopclock_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/t24_hours_example.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/example/timex.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/perf/
sandbox/stopwatches/libs/chrono/stopwatches/perf/stopclock_perf.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/test/
sandbox/stopwatches/libs/chrono/stopwatches/test/Jamfile.v2 (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/test/stopclock_constructor_overload_test.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/test/test_minmax.cpp (contents, props changed)
sandbox/stopwatches/libs/chrono/stopwatches/test/wstopclock_constructor_overload_test.cpp (contents, props changed)
Added: sandbox/stopwatches/boost/chrono/stopwatches.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,20 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2010.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/stm for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STOPWATCHES_HPP
+#define BOOST_STOPWATCHES_HPP
+
+//-----------------------------------------------------------------------------
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+//-----------------------------------------------------------------------------
+
+#endif // BOOST_STOPWATCHES_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,37 @@
+// boost/chrono/stopwatches/clock_suspender.hpp -----------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_CLOCK_SUSPENDER_CLOCK_HPP
+#define BOOST_STOPWATCHES_CLOCK_SUSPENDER_CLOCK_HPP
+
+#include <boost/system/error_code.hpp>
+#include <boost/mpl/bool.hpp>
+
+namespace boost { namespace chrono {
+
+
+ template <class Clock>
+ struct is_suspendible : mpl:: false_ {};
+
+ template <class Clock>
+ class clock_suspender {
+ public:
+ clock_suspender(system::error_code & ec = BOOST_CHRONO_THROWS) {
+ ec.clear();
+ }
+ ~clock_suspender() {}
+ private:
+ //~ clock_suspender(); // = delete;
+ clock_suspender(const clock_suspender&); // = delete;
+ clock_suspender& operator=(const clock_suspender&); // = delete;
+ };
+
+
+} // namespace chrono
+} // namespace boost
+
+
+#endif // BOOST_CHRONO_PROCESS_CPU_CLOCKS_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/config.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/config.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,14 @@
+// boost/chrono/stopwatches/config.hpp -------------------------------------------------//
+// Copyright Beman Dawes 2003, 2006, 2008
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_CONFIG_HPP
+#define BOOST_STOPWATCHES_CONFIG_HPP
+
+#include <boost/config.hpp>
+
+#endif // BOOST_STOPWATCHES_CONFIG_HPP
+
Added: sandbox/stopwatches/boost/chrono/stopwatches/detail/adaptive_string.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/detail/adaptive_string.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,63 @@
+// boost/chrono/stopwatch_formatter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_DETAIL_ADAPTIVE_STRING_HPP
+#define BOOST_STOPWATCHES_DETAIL_ADAPTIVE_STRING_HPP
+
+#include <string>
+
+namespace boost { namespace chrono {
+
+namespace detail {
+
+ /**
+ * this class is a shim between std::string type and wchar_t type.
+ * it accepts a std::string type and returns a std::string or
+ * std::wstring according to the context(e.g. type on the left side
+ * of '=' operator):
+ * - in case of a string type, it forwards the passed-in std::string
+ * - in case of a wstring type, it widens it passed-in std::string
+ * before forwarding
+ *
+ * typical usage:
+ * std::string s = adaptive_string("hello"); // s = "hello"
+ * std::wstring ws = adaptive_string("hello"); // ws = L"hello"
+ * N.B. it doe not do any code conversion like: MBCS <--> UNICODE
+ */
+
+ struct adaptive_string
+ {
+ adaptive_string(const std::string& s):str_(s)
+ {}
+
+ // implicit convert to any basic_string
+ template <
+ typename CharT,
+ typename Traits,
+ class Alloc
+ >
+ operator std::basic_string<CharT, Traits, Alloc>() const
+ {
+ //return str_;
+ std::basic_string<CharT, Traits, Alloc> s;
+ s.assign(str_.begin(), str_.end());
+ return s;
+ }
+ adaptive_string(const adaptive_string& rhs) : str_(rhs.str_)
+ {}
+
+ private:
+ const std::string& str_;
+ adaptive_string& operator=(const adaptive_string&); // = delete;
+ };
+
+
+} // namespace detail
+} // namespace chrono
+} // namespace boost
+
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/detail/default_out.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/detail/default_out.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,39 @@
+// boost/chrono/stopwatch_formatter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_DETAIL_DEFAULT_OUT_HPP
+#define BOOST_STOPWATCHES_DETAIL_DEFAULT_OUT_HPP
+
+#include <boost/chrono/stopwatches/config.hpp>
+#include <iostream>
+
+namespace boost { namespace chrono {
+
+
+namespace detail {
+ template <typename CharT,typename Traits>
+ struct default_out;
+ template <typename Traits>
+ struct default_out<char,Traits> {
+ static std::basic_ostream<char,Traits>& apply() {
+ return std::cout;
+ }
+ };
+#ifndef BOOST_NO_STD_WSTRING
+ template <typename Traits>
+ struct default_out<wchar_t,Traits> {
+ static std::basic_ostream<wchar_t,Traits>& apply() {
+ return std::wcout;
+ }
+ };
+#endif
+}
+
+ } // namespace chrono
+} // namespace boost
+
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/detail/static_assert.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/detail/static_assert.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,28 @@
+// boost/stopwatches/detail/static_assert.hpp --------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_DETAIL_STATIC_ASSERT_HPP
+#define BOOST_STOPWATCHES_DETAIL_STATIC_ASSERT_HPP
+
+#include <boost/chrono/stopwatches/config.hpp>
+
+#ifndef BOOST_NO_STATIC_ASSERT
+#define BOOST_STOPWATCHES_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
+#elif defined(BOOST_STOPWATCHES_USES_STATIC_ASSERT)
+#include <boost/static_assert.hpp>
+#define BOOST_STOPWATCHES_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
+#elif defined(BOOST_STOPWATCHES_USES_MPL_ASSERT)
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#define BOOST_STOPWATCHES_STATIC_ASSERT(CND, MSG, TYPES) \
+ BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
+#elif defined(BOOST_STOPWATCHES_USES_ARRAY_ASSERT)
+#define BOOST_STOPWATCHES_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_JOIN(boost_chrono_test_,__LINE__)[CND]
+#else
+#define BOOST_STOPWATCHES_STATIC_ASSERT(CND, MSG, TYPES)
+#endif
+
+#endif // BOOST_STOPWATCHES_DETAIL_STATIC_ASSERT_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,287 @@
+// boost/chrono/stopwatches/lightweight_stopwatch.hpp ------------------------------------------------------------//
+// Copyright 2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_LIGHTWEIGHT_STOPWATCH__HPP
+#define BOOST_STOPWATCHES_LIGHTWEIGHT_STOPWATCH__HPP
+
+#include <utility>
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/stopwatches/stopwatch_scoped.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/statistics/count.hpp>
+#include <boost/accumulators/statistics/sum.hpp>
+#include <boost/accumulators/statistics/min.hpp>
+#include <boost/accumulators/statistics/max.hpp>
+#include <boost/accumulators/statistics/mean.hpp>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+ template <typename Features, typename Weight=void>
+ struct lightweight_stopwatch_accumulator_set_traits {
+ template <typename D>
+ struct apply {
+ struct type {
+ typedef accumulators::accumulator_set<typename D::rep, Features, Weight> storage_type;
+ typedef D duration_type;
+ static duration_type get_duration(storage_type& acc_) { return duration_type(accumulators::sum(acc_)); }
+ static void set_duration(storage_type& acc_, duration_type d) { acc_(d.count()); }
+ static void reset(storage_type& acc_) { acc_=storage_type(); }
+ };
+ };
+ };
+
+ struct lightweight_stopwatch_identity_traits {
+ template <typename D>
+ struct apply {
+ struct type {
+ typedef D duration_type;
+ typedef duration_type storage_type;
+ static duration_type get_duration(storage_type& acc_) { return acc_; }
+ static void set_duration(storage_type& acc_, duration_type d) { acc_=d; }
+ static void reset(storage_type& acc_) { acc_=storage_type(); }
+ };
+ };
+
+ };
+
+
+ struct dont_start_t{};
+ static const dont_start_t dont_start = {};
+
+ // forward declaration
+ template <
+ typename Clock=chrono::high_resolution_clock,
+ typename Traits=lightweight_stopwatch_identity_traits
+ >
+ class lightweight_stopwatch;
+
+
+//--------------------------------------------------------------------------------------//
+ template <typename Clock, typename Traits>
+ class lightweight_stopwatch
+ {
+ public:
+ typedef typename Traits::template apply<typename Clock::duration>::type traits;
+ typedef typename traits::storage_type storage_type;
+ typedef Clock clock;
+ typedef typename Clock::duration duration;
+ typedef typename Clock::time_point time_point;
+ typedef typename Clock::rep rep;
+ typedef typename Clock::period period;
+
+ explicit lightweight_stopwatch( storage_type& acc, system::error_code & ec = BOOST_CHRONO_THROWS )
+ : running_(false), suspended_(false),
+ start_(duration::zero()), level_(0), partial_(duration::zero()), suspend_level_(0)
+ , storage_(&acc), construction_(clock::now( ))
+ {
+ start(ec);
+ }
+
+ lightweight_stopwatch( storage_type& acc, const dont_start_t& )
+ : running_(false), suspended_(false),
+ start_(duration::zero()), level_(0), partial_(duration::zero()), suspend_level_(0)
+ , storage_(&acc), construction_(clock::now( ))
+ {
+ }
+
+ ~lightweight_stopwatch() {
+ system::error_code ec;
+ stop(ec);
+ }
+
+
+//--------------------------------------------------------------------------------------//
+ std::pair<duration, time_point> restart( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ time_point tmp=clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return time_point();
+ }
+ if (running_&&(level_==1)) {
+ partial_ += tmp - start_;
+ traits::set_duration(get_storage(),partial_);
+ partial_=duration::zero();
+ } else {
+ running_=true;
+ }
+ start_=tmp;
+ return std::make_pair(traits::get_duration(get_storage()),start_);
+ }
+
+ time_point start( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ if (!running_) {
+ time_point tmp = clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) {
+ return time_point();
+ }
+ }
+ start_ = tmp;
+ ++level_;
+ running_ = true;
+ return start_;
+ } else {
+ ++level_;
+ ec.clear();
+ return time_point();
+ }
+ }
+
+ duration stop( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ if (running_ && (--level_==0)) {
+ time_point tmp=clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return duration::zero();
+ }
+ partial_ += tmp - start_;
+ traits::set_duration(get_storage(),partial_);
+ partial_=duration::zero();
+ running_=false;
+ return traits::get_duration(get_storage());
+ } else {
+ ec.clear();
+ return duration::zero();
+ }
+ }
+
+ duration suspend( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ if (running_) {
+ if (!suspended_) {
+ time_point tmp=clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return duration::zero();
+ }
+ ++suspend_level_;
+ partial_ += tmp - start_;
+ suspended_=true;
+ return traits::get_duration(get_storage());
+ } else {
+ ++suspend_level_;
+ ec.clear();
+ return duration::zero();
+ }
+ } else {
+ ec.clear();
+ return duration::zero();
+ }
+ }
+
+ time_point resume( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ if (suspended_&&(--suspend_level_==0)) {
+ time_point tmp = clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return time_point();
+ }
+ start_ = tmp;
+ suspended_=false;
+ return start_;
+ } else {
+ ec.clear();
+ return time_point();
+ }
+ }
+
+ duration elapsed( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ if (running_) {
+ if (suspended_)
+ return traits::get_duration(get_storage());
+ else {
+ time_point tmp = clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return duration::zero();
+ }
+ return traits::get_duration(get_storage())+tmp - start_;
+ }
+ } else {
+ return traits::get_duration(get_storage());
+ }
+ }
+
+ time_point now( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ return time_point(elapsed( ec ));
+ }
+
+ void reset( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ construction_=clock::now( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ traits::reset(get_storage());
+ running_=false;
+ suspended_=false;
+ partial_ = duration::zero();
+ start_ = time_point(duration::zero());
+ level_=0;
+ suspend_level_=0;
+ }
+
+ storage_type& get_storage( )
+ {
+ return *storage_;
+ }
+
+ duration lifetime( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ return clock::now( ec ) - construction_;
+ }
+
+ typedef stopwatch_runner<lightweight_stopwatch<Clock,Traits> > scoped_run;
+ typedef stopwatch_stopper<lightweight_stopwatch<Clock,Traits> > scoped_stop;
+ typedef stopwatch_suspender<lightweight_stopwatch<Clock,Traits> > scoped_suspend;
+ typedef stopwatch_resumer<lightweight_stopwatch<Clock,Traits> > scoped_resume;
+ private:
+ bool running_;
+ bool suspended_;
+ time_point start_;
+ std::size_t level_;
+ duration partial_;
+ std::size_t suspend_level_;
+ storage_type* storage_;
+ time_point construction_;
+ };
+
+//--------------------------------------------------------------------------------------//
+ typedef accumulators::features<
+ accumulators::tag::count,
+ accumulators::tag::sum,
+ accumulators::tag::min,
+ accumulators::tag::max,
+ accumulators::tag::mean
+ > default_features;
+ typedef boost::chrono::lightweight_stopwatch< boost::chrono::system_clock > system_lightweight_stopwatch;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::lightweight_stopwatch< boost::chrono::steady_clock > steady_lightweight_stopwatch;
+#endif
+ typedef boost::chrono::lightweight_stopwatch< boost::chrono::high_resolution_clock > high_resolution_lightweight_stopwatch;
+
+ typedef boost::chrono::lightweight_stopwatch< boost::chrono::system_clock,
+ lightweight_stopwatch_accumulator_set_traits<default_features> > system_lightweight_stopwatch_accumulator;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::lightweight_stopwatch< boost::chrono::steady_clock,
+ lightweight_stopwatch_accumulator_set_traits<default_features> > steady_lightweight_stopwatch_accumulator;
+#endif
+ typedef boost::chrono::lightweight_stopwatch< boost::chrono::high_resolution_clock,
+ lightweight_stopwatch_accumulator_set_traits<default_features> > high_resolution_lightweight_stopwatch_accumulator;
+
+//--------------------------------------------------------------------------------------//
+
+
+ } // namespace chrono
+} // namespace boost
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,115 @@
+// boost/chrono/stopwatches/stopclock.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_SCOPED_STOPCLOCK_HPP
+#define BOOST_STOPWATCHES_SCOPED_STOPCLOCK_HPP
+
+#include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
+#include <boost/chrono/stopwatches/stopwatch.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/chrono/stopwatches/time_formatter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp>
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//~ provides a everything a Timer provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+ //~ * format : The output format
+ //~ * places(precission): the number of decimal placess used.
+
+//~ The default places is given by default_places and is 3. The default format is "\n%ts\n", where
+
+ //~ * %t : the result of elapsed() when the reporting is done.
+
+//~ The time is given using the suffix "s" following the System International d'Unites Std.
+
+/* void f1()
+ * {
+ * stopclock<> _;
+ * // ...
+ * }
+ */
+//--------------------------------------------------------------------------------------//
+
+ template <class Clock=chrono::process_cpu_clock, class Formatter=typename stopwatch_reporter_default_formatter<chrono::stopwatch<Clock> >::type >
+ class scoped_stopclock
+ : public stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> {
+ typedef stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef chrono::stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit scoped_stopclock( const string_type& func, system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec), func_(func)
+ { begin(); }
+ scoped_stopclock( const string_type& func, ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec), func_(func)
+ { begin(); }
+
+ scoped_stopclock( const string_type& func, ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec), func_(func)
+ { begin(); }
+
+ ~scoped_stopclock() {
+ this->m_os << "}}} " << func_ << " : ";
+ }
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ private:
+ void begin() {
+ this->m_os << "{{{ " << func_ << std::endl;
+ }
+ string_type func_;
+
+ };
+
+ } // namespace chrono
+} // namespace boost
+
+#endif // BOOST_STOPWATCHES_STOPCLOCK_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,286 @@
+// boost/chrono/stopwatches/stopclock.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPCLOCK_HPP
+#define BOOST_STOPWATCHES_STOPCLOCK_HPP
+
+#include <boost/chrono/stopwatches/config.hpp>
+#include <boost/chrono/stopwatches/detail/static_assert.hpp>
+#include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_formatter.hpp>
+#include <boost/chrono/stopwatches/time_formatter.hpp>
+#include <boost/chrono/stopwatches/stopwatch.hpp>
+#include <boost/chrono/stopwatches/suspendible_clock.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//~ provides a everything a Timer provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+ //~ * format : The output format
+ //~ * places(precission): the number of decimal placess used.
+
+//~ The default places is given by default_places and is 3. The default format is "\n%ts\n", where
+
+ //~ * %t : the result of elapsed() when the reporting is done.
+
+//~ The time is given using the suffix "s" following the System International d'Unites Std.
+
+/* void f1()
+ * {
+ * stopclock<> _;
+ * // ...
+ * }
+ */
+//--------------------------------------------------------------------------------------//
+
+ template <class Clock>
+ struct stopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef stopwatch_formatter type;
+ };
+
+ template <class Clock>
+ struct wstopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef wstopwatch_formatter type;
+ };
+
+ template <>
+ struct stopwatch_reporter_default_formatter<stopwatch<chrono::process_cpu_clock> > {
+ typedef time_formatter type;
+ };
+
+ template <>
+ struct wstopwatch_reporter_default_formatter<stopwatch<chrono::process_cpu_clock> > {
+ typedef wtime_formatter type;
+ };
+
+ template <>
+ struct stopwatch_reporter_default_formatter<stopwatch<chrono::suspendible_clock<chrono::process_cpu_clock> > > {
+ typedef stopwatch_reporter_default_formatter<stopwatch<chrono::process_cpu_clock> >::type type;
+ };
+
+ template <>
+ struct wstopwatch_reporter_default_formatter<stopwatch<chrono::suspendible_clock<chrono::process_cpu_clock> > > {
+ typedef wstopwatch_reporter_default_formatter<stopwatch<chrono::process_cpu_clock> >::type type;
+ };
+
+
+ template <class Clock, class Formatter>
+ class basic_stopclock : public basic_stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> {
+ typedef basic_stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef chrono::stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit basic_stopclock( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit basic_stopclock( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit basic_stopclock( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit basic_stopclock( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ basic_stopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ basic_stopclock( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ basic_stopclock( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ basic_stopclock( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ basic_stopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ basic_stopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<basic_stopclock> scoped_run;
+ typedef stopwatch_stopper<basic_stopclock> scoped_stop;
+ typedef stopwatch_suspender<basic_stopclock> scoped_suspend;
+ typedef stopwatch_resumer<basic_stopclock> scoped_resume;
+
+ };
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<basic_stopclock<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock=chrono::process_cpu_clock, class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
+ class stopclock;
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<stopclock<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock, class Formatter>
+ class stopclock : public basic_stopclock<Clock, Formatter> {
+ typedef basic_stopclock<Clock, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef chrono::stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit stopclock( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit stopclock( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit stopclock( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit stopclock( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ stopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ stopclock( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ stopclock( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ stopclock( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ stopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ stopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<stopclock> scoped_run;
+ typedef stopwatch_stopper<stopclock> scoped_stop;
+ typedef stopwatch_suspender<stopclock> scoped_suspend;
+ typedef stopwatch_resumer<stopclock> scoped_resume;
+
+ };
+
+ typedef stopclock< boost::chrono::system_clock > system_stopclock;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef stopclock< boost::chrono::steady_clock > steady_stopclock;
+ #endif
+ typedef stopclock< boost::chrono::high_resolution_clock > high_resolution_stopclock;
+ typedef stopclock< boost::chrono::process_real_cpu_clock > process_real_cpu_stopclock;
+ typedef stopclock< boost::chrono::process_user_cpu_clock > process_user_cpu_stopclock;
+ typedef stopclock< boost::chrono::process_system_cpu_clock > process_system_cpu_stopclock;
+ typedef stopclock< boost::chrono::process_cpu_clock > process_cpu_stopclock;
+
+ template <class Clock=chrono::process_cpu_clock, class Formatter=typename wstopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
+ class wstopclock;
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<wstopclock<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock, class Formatter>
+ class wstopclock : public basic_stopclock<Clock, Formatter> {
+ typedef basic_stopclock<Clock, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef chrono::stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopclock( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit wstopclock( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit wstopclock( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit wstopclock( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ wstopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ wstopclock( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ wstopclock( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ wstopclock( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ wstopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ wstopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<wstopclock> scoped_run;
+ typedef stopwatch_stopper<wstopclock> scoped_stop;
+ typedef stopwatch_suspender<wstopclock> scoped_suspend;
+ typedef stopwatch_resumer<wstopclock> scoped_resume;
+
+ };
+
+ typedef wstopclock< boost::chrono::system_clock > system_wstopclock;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef wstopclock< boost::chrono::steady_clock > steady_wstopclock;
+ #endif
+ typedef wstopclock< boost::chrono::high_resolution_clock > high_resolution_wstopclock;
+ typedef wstopclock< boost::chrono::process_real_cpu_clock > process_real_cpu_wstopclock;
+ typedef wstopclock< boost::chrono::process_user_cpu_clock > process_user_cpu_wstopclock;
+ typedef wstopclock< boost::chrono::process_system_cpu_clock > process_system_cpu_wstopclock;
+ typedef wstopclock< boost::chrono::process_cpu_clock > process_cpu_wstopclock;
+
+
+ } // namespace chrono
+} // namespace boost
+
+#endif // BOOST_STOPWATCHES_STOPCLOCK_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,288 @@
+// boost/chrono/stopwatches/stopclock.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_HPP
+#define BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_HPP
+
+#include <boost/chrono/stopwatches/config.hpp>
+#include <boost/chrono/stopwatches/detail/static_assert.hpp>
+
+#include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp>
+#include <boost/chrono/stopwatches/suspendible_clock.hpp>
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//~ provides a everything a Timer provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+ //~ * format : The output format
+ //~ * places(precission): the number of decimal placess used.
+
+//~ The default places is given by default_places and is 3. The default format is "\n%ts\n", where
+
+ //~ * %t : the result of elapsed() when the reporting is done.
+
+//~ The time is given using the suffix "s" following the System International d'Unites Std.
+
+/* void f1()
+ * {
+ * stopclock<> _;
+ * // ...
+ * }
+ */
+//--------------------------------------------------------------------------------------//
+
+ template <class Clock, typename Features, typename Weight>
+ struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Features,Weight> > {
+ typedef stopwatch_accumulator_formatter type;
+ };
+
+ template <class Clock, typename Features, typename Weight>
+ struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Features,Weight> > {
+ typedef wstopwatch_accumulator_formatter type;
+ };
+
+ template <typename Features, typename Weight>
+ struct stopwatch_reporter_default_formatter<stopwatch_accumulator<chrono::process_cpu_clock,Features,Weight> > {
+ typedef stopwatch_accumulator_time_formatter type;
+ };
+
+ template <typename Features, typename Weight>
+ struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<chrono::process_cpu_clock, Features,Weight> > {
+ typedef wstopwatch_accumulator_time_formatter type;
+ };
+
+ template <typename Features, typename Weight>
+ struct stopwatch_reporter_default_formatter<stopwatch_accumulator<chrono::suspendible_clock<chrono::process_cpu_clock>, Features,Weight> > {
+ typedef stopwatch_reporter_default_formatter<stopwatch_accumulator<chrono::process_cpu_clock> >::type type;
+ };
+
+ template <typename Features, typename Weight>
+ struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<chrono::suspendible_clock<chrono::process_cpu_clock>, Features,Weight> > {
+ typedef wstopwatch_reporter_default_formatter<stopwatch_accumulator<chrono::process_cpu_clock> >::type type;
+ };
+
+
+ template <class Clock, class Formatter>
+ class basic_stopclock_accumulator : public basic_stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> {
+ typedef basic_stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit basic_stopclock_accumulator( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit basic_stopclock_accumulator( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit basic_stopclock_accumulator( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit basic_stopclock_accumulator( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ basic_stopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ basic_stopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+
+ typedef stopwatch_runner<basic_stopclock_accumulator> scoped_run;
+ typedef stopwatch_stopper<basic_stopclock_accumulator> scoped_stop;
+ typedef stopwatch_suspender<basic_stopclock_accumulator> scoped_suspend;
+ typedef stopwatch_resumer<basic_stopclock_accumulator> scoped_resume;
+ };
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<basic_stopclock_accumulator<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock=chrono::high_resolution_clock, class Formatter=typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type>
+ class stopclock_accumulator;
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<stopclock_accumulator<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock, class Formatter>
+ class stopclock_accumulator : public basic_stopclock_accumulator<Clock, Formatter> {
+ typedef basic_stopclock_accumulator<Clock, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit stopclock_accumulator( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit stopclock_accumulator( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit stopclock_accumulator( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit stopclock_accumulator( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ stopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ stopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ stopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ stopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ stopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ stopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+
+ typedef stopwatch_runner<stopclock_accumulator> scoped_run;
+ typedef stopwatch_stopper<stopclock_accumulator> scoped_stop;
+ typedef stopwatch_suspender<stopclock_accumulator> scoped_suspend;
+ typedef stopwatch_resumer<stopclock_accumulator> scoped_resume;
+ };
+
+ typedef stopclock_accumulator< boost::chrono::system_clock > system_stopclock_accumulator;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef stopclock_accumulator< boost::chrono::steady_clock > steady_stopclock_accumulator;
+ #endif
+ typedef stopclock_accumulator< boost::chrono::high_resolution_clock > high_resolution_stopclock_accumulator;
+ typedef stopclock_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_stopclock_accumulator;
+ typedef stopclock_accumulator< boost::chrono::process_user_cpu_clock > process_user_cpu_stopclock_accumulator;
+ typedef stopclock_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_stopclock_accumulator;
+ typedef stopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_stopclock_accumulator;
+
+ template <class Clock=chrono::high_resolution_clock, class Formatter=typename wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type>
+ class wstopclock_accumulator;
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<wstopclock_accumulator<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock, class Formatter>
+ class wstopclock_accumulator : public basic_stopclock_accumulator<Clock, Formatter> {
+ typedef basic_stopclock_accumulator<Clock, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopclock_accumulator( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit wstopclock_accumulator( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit wstopclock_accumulator( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit wstopclock_accumulator( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ wstopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ wstopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+
+ typedef stopwatch_runner<wstopclock_accumulator> scoped_run;
+ typedef stopwatch_stopper<wstopclock_accumulator> scoped_stop;
+ typedef stopwatch_suspender<wstopclock_accumulator> scoped_suspend;
+ typedef stopwatch_resumer<wstopclock_accumulator> scoped_resume;
+ };
+
+ typedef wstopclock_accumulator< boost::chrono::system_clock > system_wstopclock_accumulator;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef wstopclock_accumulator< boost::chrono::steady_clock > steady_wstopclock_accumulator;
+ #endif
+ typedef wstopclock_accumulator< boost::chrono::high_resolution_clock > high_resolution_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_user_cpu_clock > process_user_cpu_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_wstopclock_accumulator;
+
+
+ } // namespace chrono
+} // namespace boost
+
+#endif // BOOST_STOPWATCHES_STOPCLOCK_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,70 @@
+// boost/chrono/stopwatches/stopwatch.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_HPP
+
+#include <utility>
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/stopwatches/stopwatch_scoped.hpp>
+#include <boost/chrono/stopwatches/lightweight_stopwatch.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/utility/base_from_member.hpp>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+//--------------------------------------------------------------------------------------//
+// stopwatch
+//
+//~ A stopwatch is a class designed to measure the amount of time elapsed from a particular time
+//~ when activated to when it is deactivated.
+
+//~ Calling start starts the timer running, and calling stop stops it.
+//~ A call to reset resets the stopwatch to zero.
+//~ A stopwatch can also also used to record split times or lap times.
+//~ The elapsed time since the last start is available through the elapsed function.
+//--------------------------------------------------------------------------------------//
+
+ //~ template <class Clock=chrono::high_resolution_clock>
+ template <class Clock=chrono::system_clock>
+ class stopwatch;
+
+ //~ struct dont_start_t{};
+ //~ static const dont_start_t dont_start = {};
+//--------------------------------------------------------------------------------------//
+
+ template <class Clock>
+ class stopwatch : private base_from_member<typename Clock::duration>, public lightweight_stopwatch<Clock>
+ {
+ public:
+ typedef base_from_member<typename Clock::duration> pbase_type;
+ explicit stopwatch( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : pbase_type(), lightweight_stopwatch<Clock>(pbase_type::member, ec)
+ {
+ }
+
+ explicit stopwatch( const dont_start_t& t )
+ : pbase_type(), lightweight_stopwatch<Clock>(pbase_type::member, t)
+ { }
+
+ };
+
+//--------------------------------------------------------------------------------------//
+ typedef boost::chrono::stopwatch< boost::chrono::system_clock > system_stopwatch;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::stopwatch< boost::chrono::steady_clock > steady_stopwatch;
+#endif
+ typedef boost::chrono::stopwatch< boost::chrono::high_resolution_clock > high_resolution_stopwatch;
+
+
+
+ } // namespace chrono
+} // namespace boost
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,80 @@
+// boost/chrono/stopwatches/stopwatch_accumulator.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_HPP
+
+#include <utility>
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/stopwatches/stopwatch_scoped.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/chrono/stopwatches/lightweight_stopwatch.hpp>
+#include <boost/utility/base_from_member.hpp>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+//--------------------------------------------------------------------------------------//
+// stopwatch
+//
+//~ A stopwatch accumulator is a class designed to measure the amount of time elapsed from a particular time
+//~ when activated to when it is deactivated.
+
+//~ Calling start starts the timer running, and calling stop stops it.
+//~ A call to reset resets the stopwatch to zero.
+//~ A stopwatch can also be used to record split times or lap times.
+//~ The elapsed time since the last start is available through the elapsed function.
+//--------------------------------------------------------------------------------------//
+
+ // forward declaration
+ template <class Clock=chrono::high_resolution_clock,
+ typename Features=accumulators::features<
+ accumulators::tag::count,
+ accumulators::tag::sum,
+ accumulators::tag::min,
+ accumulators::tag::max,
+ accumulators::tag::mean >,
+ typename Weight=void
+ >
+ class stopwatch_accumulator;
+
+
+//--------------------------------------------------------------------------------------//
+
+ template <class Clock, typename Features, typename Weight>
+ class stopwatch_accumulator
+ : private base_from_member<
+ typename accumulators::accumulator_set<typename Clock::duration::rep, Features, Weight>
+ //~ typename lightweight_stopwatch_accumulator_set_traits<Features,Weight>::template apply<Clock::duration>::storage_type
+ >,
+ public lightweight_stopwatch<Clock,lightweight_stopwatch_accumulator_set_traits<Features,Weight> >
+ {
+ public:
+ typedef base_from_member<typename accumulators::accumulator_set<typename Clock::duration::rep, Features, Weight> > pbase_type;
+
+ stopwatch_accumulator( )
+ : pbase_type(),
+ lightweight_stopwatch<Clock,lightweight_stopwatch_accumulator_set_traits<Features,Weight> >(pbase_type::member, dont_start)
+ { }
+ };
+
+//--------------------------------------------------------------------------------------//
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::system_clock > system_stopwatch_accumulator;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::steady_clock > steady_stopwatch_accumulator;
+#endif
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::high_resolution_clock > high_resolution_stopwatch_accumulator;
+
+//--------------------------------------------------------------------------------------//
+
+
+ } // namespace chrono
+} // namespace boost
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,167 @@
+// boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_FORMATTER_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_FORMATTER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/current_function.hpp>
+#include <boost/chrono/stopwatches/detail/default_out.hpp>
+#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/statistics/sum.hpp>
+#include <boost/accumulators/statistics/min.hpp>
+#include <boost/accumulators/statistics/max.hpp>
+#include <boost/accumulators/statistics/mean.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/assert.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+
+#define BOOST_STOPWATCHES_ACCUMULATOR_FORMAT_DEFAULT "%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fHz, lifetime=%ls, percentage=%p%\n"
+
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_stopwatch_accumulator_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+
+ static ostream_type & default_os();
+ static const char_type* default_format();
+ static string_type format(const char_type* s) {
+ string_type res(s);
+ res += boost::chrono::detail::adaptive_string(" : ");
+ res += default_format();
+ return res;
+ }
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char_type* format, int places, ostream_type & os, system::error_code & ec)
+ // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+ // be as low as 10, although will be 15 for many common platforms.
+ {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ ec.clear();
+ }
+ typedef typename Stopwatch::storage_type accumulator;
+ typedef typename Stopwatch::duration duration_t;
+ accumulator& acc = stopwatch_.get_storage();
+ duration_t lt= stopwatch_.lifetime(ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ //if ( d < duration_t::zero() ) return;
+ if ( places > 9 )
+ places = 9; // sanity check
+ else if ( places < 0 )
+ places = 0;
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ for ( ; *format; ++format ) {
+ if ( (*format != '%') || (!*(format+1)) || (!std::strchr("acflmMps", *(format+1))) ) {
+ os << *format;
+ } else {
+ ++format;
+ switch ( *format ) {
+ case 's':
+ os << boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count();
+ break;
+ case 'm':
+ os << boost::chrono::duration<double>(duration_t((accumulators::min)(acc))).count();
+ break;
+ case 'M':
+ os << boost::chrono::duration<double>(duration_t((accumulators::max)(acc))).count();
+ break;
+ case 'a':
+ os << ((accumulators::count(acc)>0)
+ //? boost::chrono::duration<double>(duration_t(typename duration_t::rep(accumulators::mean(acc)))).count()
+ ? boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count() / accumulators::count(acc)
+ : 0);
+ break;
+ case 'c':
+ os << accumulators::count(acc);
+ break;
+ case 'f':
+ os << ((accumulators::count(acc)>0)
+ ? accumulators::count(acc)/boost::chrono::duration<double>(lt)
+ : 0);
+ break;
+ case 'l':
+ os << boost::chrono::duration<double>(lt).count();
+ break;
+ case 'p':
+ os << int(boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count()*100/boost::chrono::duration<double>(lt).count());
+ break;
+ default:
+ BOOST_ASSERT(0 && "basic_stopwatch_accumulator_formatter internal logic error");
+ }
+ }
+ }
+ }
+ };
+
+namespace detail {
+ template <typename CharT>
+ struct basic_stopwatch_accumulator_formatter_default_format;
+ template <>
+ struct basic_stopwatch_accumulator_formatter_default_format<char> {
+ static const char* apply() {return BOOST_STOPWATCHES_ACCUMULATOR_FORMAT_DEFAULT; }
+ };
+#ifndef BOOST_NO_STD_WSTRING
+ template <>
+ struct basic_stopwatch_accumulator_formatter_default_format<wchar_t> {
+ static const wchar_t* apply() {return L"%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fHz, lifetime=%ls, percentage=%p%\n"; }
+ };
+
+#endif
+}
+
+ template <typename CharT,typename Traits, class Alloc>
+ const typename basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::char_type*
+ basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::default_format() {
+ return detail::basic_stopwatch_accumulator_formatter_default_format<CharT>::apply();
+ }
+
+ template <typename CharT,typename Traits, class Alloc>
+ typename basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::ostream_type &
+ basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::default_os() { return detail::default_out<CharT,Traits>::apply(); }
+
+ typedef basic_stopwatch_accumulator_formatter<char> stopwatch_accumulator_formatter;
+ typedef basic_stopwatch_accumulator_formatter<wchar_t> wstopwatch_accumulator_formatter;
+
+} // namespace chrono
+} // namespace boost
+
+#define BOOST_STOPWATCHES_ACCUMULATOR_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_STOPWATCHES_ACCUMULATOR_FORMAT_DEFAULT)
+#ifdef __GNUC__
+#define BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT boost::chrono::stopwatch_accumulator_formatter::format(BOOST_CURRENT_FUNCTION)
+#else
+#define BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT BOOST_STOPWATCHES_ACCUMULATOR_FORMAT(BOOST_CURRENT_FUNCTION)
+#endif
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,199 @@
+// boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/current_function.hpp>
+#include <boost/chrono/stopwatches/detail/default_out.hpp>
+#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/statistics/sum.hpp>
+#include <boost/accumulators/statistics/min.hpp>
+#include <boost/accumulators/statistics/max.hpp>
+#include <boost/accumulators/statistics/mean.hpp>
+#include <boost/cstdint.hpp>
+#include <boost/assert.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+#include <boost/chrono/stopwatches/time_formatter.hpp>
+
+//~ #define BOOST_STOPWATCHES_ACCUMULATOR_TIME_FORMAT_DEFAULT "%c times, sum=%s, min=%m, max=%M, mean=%a, frequency=%fHz, lifetime=%ls, percentage=%p%|real %rs, cpu %cs (%p%), user %us, system %ss\n"
+#define BOOST_STOPWATCHES_ACCUMULATOR_TIME_FORMAT_DEFAULT "%c times, sum %s, min %m, max %M, mean=%a, frequency=%fHz, lifetime=%ls, percentage=%p%\n"
+
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_stopwatch_accumulator_time_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+
+ static ostream_type & default_os();
+ static const char_type* default_format();
+ static string_type format(const char_type* s) {
+ string_type res(s);
+ res += boost::chrono::detail::adaptive_string(" : ");
+ res += default_format();
+ return res;
+ }
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char_type* format, int places, ostream_type & os, system::error_code & ec)
+ // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+ // be as low as 10, although will be 15 for many common platforms.
+ {
+ if (!BOOST_CHRONO_IS_THROWS(ec))
+ ec.clear();
+ typedef typename Stopwatch::storage_type accumulator;
+ typedef typename Stopwatch::duration duration_t;
+ accumulator& acc = stopwatch_.get_storage();
+ duration_t lt= stopwatch_.lifetime();
+
+ //if ( d < duration_t::zero() ) return;
+ if ( places > 9 )
+ places = 9; // sanity check
+ else if ( places < 0 )
+ places = 0;
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ const char_type* format2=BOOST_STOPWATCHES_TIME_FORMAT_DEFAULT;
+ //~ for (format2=format ; *format2; ++format2 ) {
+ //~ if (*format2=='|') {++format2; break;}
+ //~ }
+
+ for ( ; *format; ++format ) {
+ if ( (*format != '%') || (!*(format+1)) || (!std::strchr("acflmMps", *(format+1))) ) {
+ os << *format;
+ } else {
+ ++format;
+ switch ( *format ) {
+ case 's':
+ //~ os << boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count();
+ time_formatter::show_time<chrono::process_cpu_clock>(accumulators::sum(acc), format2, places, os, ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ //~ os << accumulators::sum(acc);
+ break;
+ case 'm':
+ //~ os << boost::chrono::duration<double>(duration_t((accumulators::min)(acc))).count();
+ time_formatter::show_time<chrono::process_cpu_clock>((accumulators::min)(acc), format2, places, os, ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ //~ os << (accumulators::min)(acc);
+ break;
+ case 'M':
+ //~ os << boost::chrono::duration<double>(duration_t((accumulators::max)(acc))).count();
+ time_formatter::show_time<chrono::process_cpu_clock>((accumulators::max)(acc), format2, places, os, ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ //~ os << (accumulators::max)(acc);
+ break;
+ case 'a':
+ if (accumulators::count(acc)>0) {
+ //? os << boost::chrono::duration<double>(duration_t(typename duration_t::rep(accumulators::mean(acc)))).count()
+ //~ os << boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count() / accumulators::count(acc)
+ time_formatter::show_time<chrono::process_cpu_clock>(accumulators::sum(acc) / accumulators::count(acc), format2, places, os, ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ } else {
+ os << 0;
+ }
+ break;
+ case 'c':
+ os << accumulators::count(acc);
+ break;
+ case 'f':
+ if (accumulators::count(acc)>0)
+ //~ os << accumulators::count(acc)/boost::chrono::duration<double>(lt);
+ os << accumulators::count(acc) << "/" << lt.count();
+ else
+ os << 0;
+ break;
+ case 'l':
+ os << lt.count();
+ break;
+ case 'p':
+ //~ os << int(boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count()*100/boost::chrono::duration<double>(lt).count());
+ os << accumulators::sum(acc)*100 << "/" << lt.count();
+ break;
+ default:
+ BOOST_ASSERT(0 && "basic_stopwatch_accumulator_time_formatter internal logic error");
+ }
+ }
+ }
+ }
+ };
+
+namespace detail {
+ template <typename CharT>
+ struct basic_stopwatch_accumulator_time_formatter_default_format;
+ template <>
+ struct basic_stopwatch_accumulator_time_formatter_default_format<char> {
+ static const char* apply() {return BOOST_STOPWATCHES_ACCUMULATOR_TIME_FORMAT_DEFAULT; }
+ };
+#ifndef BOOST_NO_STD_WSTRING
+ template <>
+ struct basic_stopwatch_accumulator_time_formatter_default_format<wchar_t> {
+ //~ static const wchar_t* apply() {return L"%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fHz, lifetime=%ls, percentage=%p%|real %rs, cpu %cs (%p%), user %us, system %ss\n"; }
+ static const wchar_t* apply() {return L"%c times, sum %s, min %m, max %M, mean %a, frequency=%fHz, lifetime=%ls, percentage=%p%\n"; }
+ };
+
+#endif
+}
+
+ template <typename CharT,typename Traits, class Alloc>
+ const typename basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::char_type*
+ basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::default_format() {
+ return detail::basic_stopwatch_accumulator_time_formatter_default_format<CharT>::apply();
+ }
+
+ template <typename CharT,typename Traits, class Alloc>
+ typename basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::ostream_type &
+ basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::default_os() { return detail::default_out<CharT,Traits>::apply(); }
+
+ typedef basic_stopwatch_accumulator_time_formatter<char> stopwatch_accumulator_time_formatter;
+ typedef basic_stopwatch_accumulator_time_formatter<wchar_t> wstopwatch_accumulator_time_formatter;
+
+
+
+
+} // namespace chrono
+} // namespace boost
+
+#define BOOST_STOPWATCHES_ACCUMULATOR_TIME_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_STOPWATCHES_ACCUMULATOR_TIME_FORMAT_DEFAULT)
+#ifdef __GNUC__
+#define BOOST_STOPWATCHES_ACCUMULATOR_TIME_FUNCTION_FORMAT boost::chrono::stopwatch_accumulator_time_formatter::format(BOOST_CURRENT_FUNCTION)
+#else
+#define BOOST_STOPWATCHES_ACCUMULATOR_TIME_FUNCTION_FORMAT BOOST_STOPWATCHES_ACCUMULATOR_TIME_FORMAT(BOOST_CURRENT_FUNCTION)
+#endif
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,130 @@
+// boost/chrono/stopwatches/stopwatch_formatter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_FORMATTER_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_FORMATTER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/current_function.hpp>
+#include <boost/chrono/stopwatches/detail/default_out.hpp>
+#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+#include <boost/assert.hpp>
+
+#define BOOST_STOPWATCHES_STOPWATCH_FORMAT_DEFAULT "%ds\n"
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_stopwatch_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+
+ static ostream_type & default_os();
+ static const char_type* default_format();
+ static string_type format(const char_type* s) {
+ string_type res(s);
+ //res += boost::chrono::detail::adaptive_string(" tokes %ds\n");
+ res += boost::chrono::detail::adaptive_string(" : ");
+ res += default_format();
+ return res;
+ }
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char_type* format, int places, ostream_type & os, system::error_code & ec)
+ // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+ // be as low as 10, although will be 15 for many common platforms.
+ {
+ typedef typename Stopwatch::duration duration_t;
+ duration_t d = stopwatch_.elapsed( ec );
+
+ if ( d < duration_t::zero() ) return;
+ if ( places > 9 )
+ places = 9; // sanity check
+ else if ( places < 0 )
+ places = 0;
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ for ( ; *format; ++format ) {
+ if ( (*format != '%') || (!*(format+1)) || (!std::strchr("d", *(format+1))) ) {
+ os << *format;
+ } else {
+ ++format;
+ switch ( *format ) {
+ case 'd':
+ os << boost::chrono::duration<double>(d).count();
+ break;
+ default:
+ BOOST_ASSERT(0 && "run_timer internal logic error");
+ }
+ }
+ }
+ }
+ };
+
+namespace detail {
+ template <typename CharT>
+ struct basic_stopwatch_formatter_default_format;
+ template <>
+ struct basic_stopwatch_formatter_default_format<char> {
+ static const char* apply() {return BOOST_STOPWATCHES_STOPWATCH_FORMAT_DEFAULT; }
+ };
+#ifndef BOOST_NO_STD_WSTRING
+ template <>
+ struct basic_stopwatch_formatter_default_format<wchar_t> {
+ static const wchar_t* apply() {return L"%ds\n"; }
+ };
+
+#endif
+}
+
+ template <typename CharT,typename Traits, class Alloc>
+ const typename basic_stopwatch_formatter<CharT,Traits,Alloc>::char_type*
+ basic_stopwatch_formatter<CharT,Traits,Alloc>::default_format() {
+ return detail::basic_stopwatch_formatter_default_format<CharT>::apply();
+ }
+
+ template <typename CharT,typename Traits, class Alloc>
+ typename basic_stopwatch_formatter<CharT,Traits,Alloc>::ostream_type &
+ basic_stopwatch_formatter<CharT,Traits,Alloc>::default_os() {
+ return detail::default_out<CharT,Traits>::apply();
+ }
+
+ typedef basic_stopwatch_formatter<char> stopwatch_formatter;
+ typedef basic_stopwatch_formatter<wchar_t> wstopwatch_formatter;
+
+ } // namespace chrono
+} // namespace boost
+
+#define BOOST_STOPWATCHES_STOPWATCH_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_STOPWATCHES_STOPWATCH_FORMAT_DEFAULT)
+#ifdef __GNUC__
+#define BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT boost::chrono::stopwatch_formatter::format(BOOST_CURRENT_FUNCTION)
+#else
+#define BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT BOOST_STOPWATCHES_STOPWATCH_FORMAT(BOOST_CURRENT_FUNCTION)
+#endif
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,352 @@
+// boost/chrono/stopwatches/stopwatch_reporter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_REPORTER_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_REPORTER_HPP
+
+#if !defined(BOOST_ENABLE_WARNINGS) && !defined(BOOST_STOPWATCHES_ENABLE_WARNINGS)
+#if defined __GNUC__
+#pragma GCC system_header
+#elif defined __SUNPRO_CC
+#pragma disable_warn
+#elif defined _MSC_VER
+#pragma warning(push, 1)
+#endif
+#endif
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/stopwatches/stopwatch_scoped.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/chrono/stopwatches/clock_suspender.hpp>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//~ provides a everything a Timer provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+ //~ * format : The output format
+ //~ * places(precission): the number of decimal placess used.
+
+//~ The default places is given by default_places and is 3. The default format is "\n%ts\n", where
+
+ //~ * %t : the result of elapsed() when the reporting is done.
+
+//~ The time is given using the suffix "s" following the System International d'Unites Std.
+
+/* void f1()
+ * {
+ * stopwatch_reporter<stopwatch<> > _;
+ * // ...
+ * }
+ */
+/* void f2()
+ * {
+ * stopwatch<>::reporter _;
+ * // ...
+ * }
+ */
+/* void f3()
+ * {
+ * static stopwatch_reporter<stopwatch_accumulator<> > t;
+ * stopwatch_reporter<stopwatch_accumulator<> >::scoped_run _(t);
+ * // ...
+ * }
+ */
+/* void f4()
+ * {
+ * static stopwatch_accumulator<>::reporter t;
+ * stopwatch_accumulator<>::reporter::scoped_run _(t);
+ * // ...
+ * }
+ */
+//--------------------------------------------------------------------------------------//
+
+ template <class Stopwatch, class Formatter>
+ class basic_stopwatch_reporter : public Stopwatch {
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ basic_stopwatch_reporter( )
+ : m_places(Formatter::default_places()), m_os(Formatter::default_os()), m_format(Formatter::default_format()), m_reported(false) {
+ }
+ explicit basic_stopwatch_reporter( system::error_code & )
+ : m_places(Formatter::default_places()), m_os(Formatter::default_os()), m_format(Formatter::default_format()), m_reported(false) {
+ }
+ explicit basic_stopwatch_reporter( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(Formatter::default_places()), m_os(os), m_format(Formatter::default_format()), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ explicit basic_stopwatch_reporter( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(Formatter::default_places()), m_os(Formatter::default_os()), m_format(format), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ explicit basic_stopwatch_reporter( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(places), m_os(Formatter::default_os()), m_format(Formatter::default_format()), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ basic_stopwatch_reporter( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(Formatter::default_places()), m_os(os), m_format(format), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ basic_stopwatch_reporter( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(places), m_os(Formatter::default_os()), m_format(format), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ basic_stopwatch_reporter( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(places), m_os(os), m_format(Formatter::default_format()), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ basic_stopwatch_reporter( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(places), m_os(Formatter::default_os()), m_format(format), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ basic_stopwatch_reporter( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(places), m_os(os), m_format(format), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ basic_stopwatch_reporter( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : m_places(places), m_os(os), m_format(format), m_reported(false) {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ }
+
+ ~basic_stopwatch_reporter() {// never throws
+ system::error_code ec;
+ //this->stop(ec);
+ if ( !reported() ) {
+ this->report( ec );
+ }
+ }
+
+
+ inline void report( system::error_code & /*ec*/ = BOOST_CHRONO_THROWS );
+ bool reported() const { return m_reported; }
+
+
+ typedef stopwatch_runner<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
+
+ protected:
+ int m_places;
+ ostream_type & m_os;
+ string_type m_format;
+ bool m_reported;
+
+
+ //basic_stopwatch_reporter(); // = delete;
+ basic_stopwatch_reporter(const basic_stopwatch_reporter&); // = delete;
+ basic_stopwatch_reporter& operator=(const basic_stopwatch_reporter&); // = delete;
+ };
+
+ template <class Stopwatch, class Formatter>
+ void basic_stopwatch_reporter<Stopwatch, Formatter>::report( system::error_code & ec ) {
+ chrono::clock_suspender<typename Stopwatch::clock> _(ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ if ( m_format.empty() ) m_format = Formatter::default_format();
+
+ m_reported = true;
+ Formatter::show_time( *this, m_format.c_str(), m_places, m_os, ec);
+ }
+
+
+ template <class Stopwatch>
+ struct stopwatch_reporter_default_formatter;
+
+ template <class Stopwatch, class Formatter=typename stopwatch_reporter_default_formatter<Stopwatch>::type>
+ class stopwatch_reporter;
+
+ template <class Stopwatch, class Formatter>
+ struct stopwatch_reporter_default_formatter<stopwatch_reporter<Stopwatch, Formatter> > {
+ typedef Formatter type;
+ };
+
+
+ template <class Stopwatch, class Formatter>
+ class stopwatch_reporter : public basic_stopwatch_reporter<Stopwatch,Formatter> {
+ typedef basic_stopwatch_reporter<Stopwatch,Formatter> base_type;
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ stopwatch_reporter( )
+ : base_type() { }
+ explicit stopwatch_reporter( system::error_code & ec )
+ : base_type(ec) { }
+ explicit stopwatch_reporter( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit stopwatch_reporter( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit stopwatch_reporter( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ stopwatch_reporter( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ stopwatch_reporter( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ stopwatch_reporter( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ stopwatch_reporter( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ stopwatch_reporter( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ stopwatch_reporter( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<stopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<stopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<stopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<stopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
+
+ protected:
+
+
+ //stopwatch_reporter(); // = delete;
+ stopwatch_reporter(const stopwatch_reporter&); // = delete;
+ stopwatch_reporter& operator=(const stopwatch_reporter&); // = delete;
+ };
+
+
+ template <class Stopwatch>
+ struct wstopwatch_reporter_default_formatter;
+
+ template <class Stopwatch, class Formatter=typename wstopwatch_reporter_default_formatter<Stopwatch>::type>
+ class wstopwatch_reporter;
+
+ template <class Stopwatch, class Formatter>
+ struct wstopwatch_reporter_default_formatter<wstopwatch_reporter<Stopwatch, Formatter> > {
+ typedef Formatter type;
+ };
+
+
+ template <class Stopwatch, class Formatter>
+ class wstopwatch_reporter : public basic_stopwatch_reporter<Stopwatch,Formatter> {
+ typedef basic_stopwatch_reporter<Stopwatch,Formatter> base_type;
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopwatch_reporter( system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(ec) { }
+ explicit wstopwatch_reporter( ostream_type & os,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, ec) { }
+
+ explicit wstopwatch_reporter( const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, ec) { }
+
+ explicit wstopwatch_reporter( int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, ec) { }
+
+ wstopwatch_reporter( const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(format, places, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, ec) { }
+
+ wstopwatch_reporter( int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(places, format, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, format, places, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = BOOST_CHRONO_THROWS )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<wstopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<wstopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<wstopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<wstopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
+
+ protected:
+
+ //wstopwatch_reporter(); // = delete;
+ wstopwatch_reporter(const wstopwatch_reporter&); // = delete;
+ wstopwatch_reporter& operator=(const wstopwatch_reporter&); // = delete;
+ };
+
+ } // namespace chrono
+} // namespace boost
+
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+
+#if !defined(BOOST_ENABLE_WARNINGS) && !defined(BOOST_STOPWATCHES_ENABLE_WARNINGS)
+#if defined __SUNPRO_CC
+#pragma enable_warn
+#elif defined _MSC_VER
+#pragma warning(pop)
+#endif
+#endif
+
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,112 @@
+// boost/chrono/stopwatches/stopwatch_scoped.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_STOPWATCH_SCOPED_HPP
+#define BOOST_STOPWATCHES_STOPWATCH_SCOPED_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/system/error_code.hpp>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+//--------------------------------------------------------------------------------------//
+ template <class Stopwatch> class stopwatch_runner {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_runner(stopwatch & a, system::error_code & ec = BOOST_CHRONO_THROWS)
+ : stopwatch_(a) {
+ stopwatch_.start(ec);
+ }
+ ~stopwatch_runner() {
+ system::error_code ec;
+ stopwatch_.stop(ec);
+ }
+#if 0
+ typename Stopwatch::duration elapsed(system::error_code & ec = BOOST_CHRONO_THROWS)
+ {
+ return stopwatch_.elapsed(ec)-stopwatch_.get_storage();
+ }
+#endif
+ private:
+ stopwatch& stopwatch_;
+ stopwatch_runner();//= delete;
+ stopwatch_runner(const stopwatch_runner&); // = delete;
+ stopwatch_runner& operator=(const stopwatch_runner&); // = delete;
+
+ };
+
+//--------------------------------------------------------------------------------------//
+ template <class Stopwatch> class stopwatch_stopper {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_stopper(stopwatch & a, system::error_code & ec = BOOST_CHRONO_THROWS)
+ : stopwatch_(a) {
+ stopwatch_.stop(ec);
+ }
+ ~stopwatch_stopper() {
+ system::error_code ec;
+ stopwatch_.start(ec);
+ }
+#if 0
+ typename Stopwatch::duration elapsed(system::error_code & ec = BOOST_CHRONO_THROWS)
+ {
+ return stopwatch_.elapsed(ec)-stopwatch_.get_storage();
+ }
+#endif
+ private:
+ stopwatch& stopwatch_;
+ stopwatch_stopper();//= delete;
+ stopwatch_stopper(const stopwatch_stopper&); // = delete;
+ stopwatch_stopper& operator=(const stopwatch_stopper&); // = delete;
+
+ };
+
+//--------------------------------------------------------------------------------------//
+ template <class Stopwatch> class stopwatch_suspender {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_suspender(stopwatch & a, system::error_code & ec = BOOST_CHRONO_THROWS)
+ : stopwatch_(a) {
+ stopwatch_.suspend(ec);
+ }
+ ~stopwatch_suspender() {
+ system::error_code ec;
+ stopwatch_.resume(ec);
+ }
+ private:
+ stopwatch& stopwatch_;
+ stopwatch_suspender(); // = delete;
+ stopwatch_suspender(const stopwatch_suspender&); // = delete;
+ stopwatch_suspender& operator=(const stopwatch_suspender&); // = delete;
+ };
+
+//--------------------------------------------------------------------------------------//
+ template <class Stopwatch> class stopwatch_resumer {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_resumer(stopwatch & a, system::error_code & ec = BOOST_CHRONO_THROWS)
+ : stopwatch_(a) {
+ stopwatch_.resume(ec);
+ }
+ ~stopwatch_resumer() {
+ system::error_code ec;
+ stopwatch_.suspend(ec);
+ }
+ private:
+ stopwatch& stopwatch_;
+ stopwatch_resumer(); // = delete;
+ stopwatch_resumer(const stopwatch_resumer&); // = delete;
+ stopwatch_resumer& operator=(const stopwatch_resumer&); // = delete;
+ };
+
+
+ } // namespace chrono
+} // namespace boost
+
+#endif
Added: sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 2011.
+// Distributed under the Boost
+// Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_STOPWATCHES_STOPWATCHES_HPP
+#define BOOST_STOPWATCHES_STOPWATCHES_HPP
+
+//-----------------------------------------------------------------------------
+#include <boost/chrono/stopwatches/scoped_stopclock.hpp>
+#include <boost/chrono/stopwatches/stopclock.hpp>
+#include <boost/chrono/stopwatches/stopclock_accumulator.hpp>
+#include <boost/chrono/stopwatches/stopwatch.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_formatter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
+#include <boost/chrono/stopwatches/stopwatch_scoped.hpp>
+#include <boost/chrono/stopwatches/time_formatter.hpp>
+#include <boost/chrono/stopwatches/t24_hours.hpp>
+#include <boost/chrono/stopwatches/t24_hours_formatter.hpp>
+//-----------------------------------------------------------------------------
+
+#endif // BOOST_STOPWATCHES_STOPWATCHES_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,198 @@
+// boost/chrono/suspendible_clock.hpp -----------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_SUSPENDIBLE_CLOCK_HPP
+#define BOOST_STOPWATCHES_SUSPENDIBLE_CLOCK_HPP
+
+#include <boost/version.hpp>
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/stopwatches/clock_suspender.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/thread/tss.hpp>
+#include <memory>
+
+namespace boost { namespace chrono {
+
+ template < class Clock=chrono::high_resolution_clock >
+ class suspendible_clock {
+ public:
+ typedef typename Clock::duration duration;
+ typedef typename Clock::rep rep;
+ typedef typename Clock::period period;
+ typedef chrono::time_point<suspendible_clock<Clock> > time_point;
+ static const bool is_steady = true;
+
+ private:
+ struct thread_specific_context {
+ bool suspended_;
+ time_point suspended_time_;
+ duration suspended_duration_;
+ std::size_t suspend_level_;
+
+ thread_specific_context()
+ : suspended_(false)
+ , suspended_time_()
+ , suspended_duration_(duration::zero())
+ , suspend_level_(0)
+ {}
+ duration suspended(system::error_code & ec = BOOST_CHRONO_THROWS) {
+ if (!suspended_) {
+ ec.clear();
+ return suspended_duration_;
+ } else {
+ time_point tmp;
+ tmp+=duration(Clock::now(ec).time_since_epoch());
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return duration::zero();
+ }
+ return suspended_duration_ + tmp - suspended_time_;
+ }
+ }
+
+ void suspend( system::error_code & ec = BOOST_CHRONO_THROWS ) {
+ if (!suspended_) {
+ time_point tmp;
+ tmp+=duration(Clock::now(ec).time_since_epoch());
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ ++suspend_level_;
+ suspended_time_ = tmp;
+ suspended_=true;
+ } else {
+ ec.clear();
+ ++suspend_level_;
+ }
+ }
+ void resume( system::error_code & ec = BOOST_CHRONO_THROWS ) {
+ if (suspended_&&(--suspend_level_==0)) {
+ time_point tmp;
+ tmp+=duration(Clock::now(ec).time_since_epoch());
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ suspended_duration_ += tmp - suspended_time_;
+ suspended_=false;
+ } else {
+ ec.clear();
+ }
+ }
+
+ };
+ static thread_specific_context* instance(system::error_code & ec) {
+ thread_specific_context* ptr= ptr_.get();
+ if (ptr==0) {
+ if (BOOST_CHRONO_IS_THROWS(ec)) {
+ std::auto_ptr<thread_specific_context> ptr2(new thread_specific_context());
+ ptr_.reset(ptr2.get());
+ ptr = ptr2.release();
+ } else {
+ ptr=(new(std::nothrow) thread_specific_context());
+ if (ptr==0) {
+#if (BOOST_VERSION / 100 % 1000) < 44
+ ec.assign( system::errc::resource_unavailable_try_again, system::generic_category );
+#else
+ ec.assign( system::errc::resource_unavailable_try_again, system::generic_category() );
+#endif
+ return 0;
+ }
+ try {
+ ptr_.reset(ptr);
+ } catch (...) {
+#if (BOOST_VERSION / 100 % 1000) < 44
+ ec.assign( system::errc::resource_unavailable_try_again, system::generic_category );
+#else
+ ec.assign( system::errc::resource_unavailable_try_again, system::generic_category() );
+#endif
+ return 0;
+ }
+ }
+ }
+ ec.clear();
+ return ptr;
+ }
+
+ static thread_specific_ptr<thread_specific_context> ptr_;
+ public:
+ static time_point now( ) {
+ time_point res;
+ res+= duration(Clock::now().time_since_epoch())-suspended();
+ return res;
+ }
+
+ static time_point now( system::error_code & ec ) {
+ time_point res;
+ typename Clock::time_point t=Clock::now(ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return time_point();
+ }
+ res+= duration(t.time_since_epoch())-suspended(ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return time_point();
+ }
+ return res;
+ }
+
+ static void suspend( system::error_code & ec = BOOST_CHRONO_THROWS ) {
+ thread_specific_context* ptr= instance(ec);
+ if (ptr!=0) ptr->suspend(ec);
+ }
+ static void resume( system::error_code & ec = BOOST_CHRONO_THROWS ) {
+ thread_specific_context* ptr= instance(ec);
+ if (ptr!=0) ptr->resume(ec);
+ }
+ static duration suspended(system::error_code & ec = BOOST_CHRONO_THROWS)
+ {
+ thread_specific_context* ptr= instance(ec);
+ if (ptr!=0) {
+ return ptr->suspended(ec);
+ }
+ else return duration::zero();
+ }
+ class clock_suspender {
+ public:
+ clock_suspender(system::error_code & ec = BOOST_CHRONO_THROWS)
+ : ptr_(instance(ec))
+ {
+ if (ptr_!=0) ptr_->suspend(ec);
+ }
+ ~clock_suspender() {
+ if (ptr_!=0) {
+ system::error_code ec;
+ ptr_->resume(ec);
+ }
+
+ }
+ private:
+ thread_specific_context* ptr_;
+ //~ clock_suspender(); // = delete;
+ clock_suspender(const clock_suspender&); // = delete;
+ clock_suspender& operator=(const clock_suspender&); // = delete;
+ };
+
+ };
+
+ template < class Clock >
+ thread_specific_ptr<typename suspendible_clock<Clock>::thread_specific_context> suspendible_clock<Clock>::ptr_;
+
+ template <class Clock>
+ struct is_suspendible<suspendible_clock<Clock> > : mpl:: true_ {};
+
+ template <class Clock>
+ class clock_suspender<suspendible_clock<Clock> >
+ : public suspendible_clock<Clock>::clock_suspender {
+ public:
+ clock_suspender(system::error_code & ec = BOOST_CHRONO_THROWS) : suspendible_clock<Clock>::clock_suspender(ec) {}
+ private:
+ //~ clock_suspender(); // = delete;
+ clock_suspender(const clock_suspender&); // = delete;
+ clock_suspender& operator=(const clock_suspender&); // = delete;
+ };
+
+} // namespace chrono
+} // namespace boost
+
+#endif // BOOST_CHRONO_SUSPENDIBLE_CLOCK_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,67 @@
+// boost/chrono/stopwatches/t24_hours.hpp -----------------------------------------------------------//
+// Copyright 2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_T24_HOURS_HPP
+#define BOOST_STOPWATCHES_T24_HOURS_HPP
+
+#include <boost/chrono/chrono.hpp>
+
+
+namespace boost { namespace chrono {
+
+class t24_hours {
+ typedef boost::chrono::duration<boost::int_least32_t, ratio<24*3600> > days;
+ typedef boost::chrono::hours hours;
+ typedef boost::chrono::minutes minutes;
+ typedef boost::chrono::seconds seconds;
+ typedef boost::chrono::nanoseconds nanoseconds;
+public:
+ days days_;
+ hours hours_;
+ minutes minutes_;
+ seconds seconds_;
+ nanoseconds nanoseconds_;
+
+ template <class Rep, class Period>
+ static days get_days(const boost::chrono::duration<Rep, Period>& d) {
+ return boost::chrono::duration_cast<days>(d);
+ }
+
+ template <class Rep, class Period>
+ static hours get_hours(const boost::chrono::duration<Rep, Period>& d) {
+ return boost::chrono::duration_cast<hours>(d % days(1));
+ }
+
+ template <class Rep, class Period>
+ static minutes get_minutes(const boost::chrono::duration<Rep, Period>& d) {
+ return boost::chrono::duration_cast<minutes>(d % hours(1));
+ }
+
+ template <class Rep, class Period>
+ static seconds get_seconds(const boost::chrono::duration<Rep, Period>& d) {
+ return boost::chrono::duration_cast<seconds>(d % minutes(1));
+ }
+
+ template <class Rep, class Period>
+ static nanoseconds get_nanoseconds(const boost::chrono::duration<Rep, Period>& d) {
+ return boost::chrono::duration_cast<nanoseconds>(d % seconds(1));
+ }
+
+ template <class Rep, class Period>
+ explicit t24_hours(const boost::chrono::duration<Rep, Period>& d)
+ : days_ (get_days(d))
+ , hours_ (get_hours(d))
+ , minutes_ (get_minutes(d))
+ , seconds_ (get_seconds(d))
+ , nanoseconds_ (get_nanoseconds(d))
+ {}
+};
+
+} // namespace chrono
+} // namespace boost
+
+
+#endif // BOOST_STOPWATCHES_PROCESS_CLOCK_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,161 @@
+// boost/chrono/stopwatches/t24_hours_formatter.hpp ------------------------------------------------------------//
+// Copyright 2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_T24_HOURS_FORMATTER_HPP
+#define BOOST_STOPWATCHES_T24_HOURS_FORMATTER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/stopwatches/t24_hours.hpp>
+#include <boost/current_function.hpp>
+#include <boost/chrono/stopwatches/detail/default_out.hpp>
+#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+#include <boost/assert.hpp>
+
+#define BOOST_STOPWATCHES_24_HOURS_FORMAT_DEFAULT "%d day(s) %h:%m:%s.%n\n"
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_24_hours_formatter {
+ public:
+
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+
+ static ostream_type & default_os();
+ static const char_type* default_format();
+ static string_type format(const char_type* s) {
+ string_type res(s);
+ res += boost::chrono::detail::adaptive_string(" : ");
+ res += default_format();
+ //res += boost::chrono::detail::adaptive_string(" tokes %d day(s) %h:%m:%s.%n\n");
+ return res;
+ }
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_
+ , const char_type* format, int places, ostream_type & os
+ , system::error_code & ec)
+ // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+ // be as low as 10, although will be 15 for many common platforms.
+ {
+ typedef typename Stopwatch::duration duration_t;
+ duration_t d = stopwatch_.elapsed( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ if ( d < duration_t::zero() ) return;
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ t24_hours dt(d);
+ for ( ; *format; ++format ) {
+ if ( (*format != '%') || (!*(format+1)) || (!std::strchr("dhmsn", *(format+1))) ) {
+ os << *format;
+ } else {
+ ++format;
+ switch ( *format ) {
+ case 'd':
+ os << dt.days_.count();
+ break;
+ case 'h':
+ {
+ boost::io::ios_flags_saver ifs( os );
+ os.width(2); os.fill('0');
+ os << dt.hours_.count();
+ break;
+ }
+ case 'm':
+ {
+ boost::io::ios_flags_saver ifs( os );
+ os.width(2); os.fill('0');
+ os << dt.minutes_.count();
+ break;
+ }
+ case 's':
+ {
+ boost::io::ios_flags_saver ifs( os );
+ os.width(2); os.fill('0');
+ os << dt.seconds_.count();
+ break;
+ }
+ case 'n':
+ {
+ boost::io::ios_flags_saver ifs( os );
+ os.width(9); os.fill('0');
+ os << dt.nanoseconds_.count();
+ break;
+ }
+ default:
+ BOOST_ASSERT(0 && "basic_24_hours_formatter internal logic error");
+ }
+ }
+ }
+ }
+ };
+
+namespace detail {
+ template <typename CharT>
+ struct basic_24_hours_formatter_default_format;
+ template <>
+ struct basic_24_hours_formatter_default_format<char> {
+ static const char* apply() {return BOOST_STOPWATCHES_24_HOURS_FORMAT_DEFAULT; }
+ };
+#ifndef BOOST_NO_STD_WSTRING
+ template <>
+ struct basic_24_hours_formatter_default_format<wchar_t> {
+ static const wchar_t* apply() {return L"%d day(s) %h:%m:%s.%n\n"; }
+ };
+
+#endif
+}
+
+ template <typename CharT,typename Traits, class Alloc>
+ const typename basic_24_hours_formatter<CharT,Traits,Alloc>::char_type*
+ basic_24_hours_formatter<CharT,Traits,Alloc>::default_format() {
+ return detail::basic_24_hours_formatter_default_format<CharT>::apply();
+ }
+
+ template <typename CharT,typename Traits, class Alloc>
+ typename basic_24_hours_formatter<CharT,Traits,Alloc>::ostream_type &
+ basic_24_hours_formatter<CharT,Traits,Alloc>::default_os() {
+ return detail::default_out<CharT,Traits>::apply();
+ }
+
+ typedef basic_24_hours_formatter<char> t24_hours_formatter;
+ typedef basic_24_hours_formatter<wchar_t> wt24_hours_formatter;
+
+ } // namespace chrono
+} // namespace boost
+
+#define BOOST_STOPWATCHES_24_HOURS_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_STOPWATCHES_24_HOURS_FORMAT_DEFAULT)
+#ifdef __GNUC__
+#define BOOST_STOPWATCHES_24_HOURS_FUNCTION_FORMAT boost::chrono::t24_hours_formatter::format(BOOST_CURRENT_FUNCTION)
+#else
+#define BOOST_STOPWATCHES_24_HOURS_FUNCTION_FORMAT BOOST_STOPWATCHES_24_HOURS_FORMAT(BOOST_CURRENT_FUNCTION)
+#endif
+
+#endif // BOOST_STOPWATCHES_T24_HOURS_FORMATTER_HPP
Added: sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,177 @@
+// boost/chrono/time_formatter.hpp ------------------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_STOPWATCHES_TIME_FORMATTER_HPP
+#define BOOST_STOPWATCHES_TIME_FORMATTER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/current_function.hpp>
+#include <boost/chrono/stopwatches/detail/default_out.hpp>
+#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+#include <boost/assert.hpp>
+
+#define BOOST_STOPWATCHES_TIME_FORMAT_DEFAULT "real %rs, cpu %cs (%p%), user %us, system %ss\n"
+
+namespace boost { namespace chrono {
+
+//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_time_formatter {
+ public:
+
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+
+ static ostream_type & default_os();
+ static const char_type* default_format();
+ static string_type format(const char_type* s) {
+ string_type res(s);
+ res += boost::chrono::detail::adaptive_string(" : ");
+ res += default_format();
+ //res += boost::chrono::detail::adaptive_string(" spent real %rs, cpu %cs (%p%), user %us, system %ss\n");
+ return res;
+ }
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( typename Stopwatch::duration::rep const & times
+ , const char_type* format, int places, ostream_type & os
+ , system::error_code & ec
+ )
+ // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+ // be as low as 10, although will be 15 for many common platforms.
+ {
+ if (!BOOST_CHRONO_IS_THROWS(ec)) ec.clear();
+ typedef typename Stopwatch::duration duration;
+ typedef typename duration::rep rep;
+ if ( times.real < 0 ) return;
+ if ( places > 9 )
+ places = 9; // sanity check
+ else if ( places < 0 )
+ places = 0;
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ chrono::nanoseconds total = chrono::nanoseconds(times.system + times.user);
+
+ for ( ; *format; ++format )
+ {
+ if ( (*format != '%') || (!*(format+1)) || (!std::strchr("rcpus", *(format+1))) )
+ os << *format;
+ else
+ {
+ ++format;
+ switch ( *format )
+ {
+ case 'r':
+ os << boost::chrono::duration<double>(chrono::nanoseconds(times.real)).count();
+ break;
+ case 'u':
+ os << boost::chrono::duration<double>(chrono::nanoseconds(times.user)).count();
+ break;
+ case 's':
+ os << boost::chrono::duration<double>(chrono::nanoseconds(times.system)).count();
+ break;
+ case 'c':
+ os << boost::chrono::duration<double>(total).count();
+ break;
+ case 'p':
+ {
+ boost::io::ios_precision_saver ips( os );
+ os.precision( 1 );
+ if ( times.real && total.count() )
+ os << boost::chrono::duration<double>(total).count()
+ /boost::chrono::duration<double>(chrono::nanoseconds(times.real)).count() * 100.0;
+ else
+ os << 0.0;
+ }
+ break;
+ default:
+ BOOST_ASSERT(0 && "basic_time_formatter internal logic error");
+ }
+ }
+ }
+ }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_
+ , const char_type* format, int places, ostream_type & os
+ , system::error_code & ec)
+ // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+ // be as low as 10, although will be 15 for many common platforms.
+ {
+ typedef typename Stopwatch::duration duration;
+ typedef typename duration::rep rep;
+ duration d = stopwatch_.elapsed( ec );
+ if (!BOOST_CHRONO_IS_THROWS(ec)) {
+ if (ec) return;
+ }
+ rep times=d.count();
+ show_time<Stopwatch>(times, format, places, os, ec);
+ }
+ };
+
+namespace detail {
+ template <typename CharT>
+ struct basic_time_formatter_default_format;
+ template <>
+ struct basic_time_formatter_default_format<char> {
+ static const char* apply() {return BOOST_STOPWATCHES_TIME_FORMAT_DEFAULT; }
+ };
+#ifndef BOOST_NO_STD_WSTRING
+ template <>
+ struct basic_time_formatter_default_format<wchar_t> {
+ static const wchar_t* apply() {return L"real %rs, cpu %cs (%p%), user %us, system %ss\n"; }
+ };
+
+#endif
+}
+
+ template <typename CharT,typename Traits, class Alloc>
+ const typename basic_time_formatter<CharT,Traits,Alloc>::char_type*
+ basic_time_formatter<CharT,Traits,Alloc>::default_format() {
+ return detail::basic_time_formatter_default_format<CharT>::apply();
+ }
+
+ template <typename CharT,typename Traits, class Alloc>
+ typename basic_time_formatter<CharT,Traits,Alloc>::ostream_type &
+ basic_time_formatter<CharT,Traits,Alloc>::default_os() {
+ return detail::default_out<CharT,Traits>::apply();
+ }
+
+ typedef basic_time_formatter<char> time_formatter;
+ typedef basic_time_formatter<wchar_t> wtime_formatter;
+
+ } // namespace chrono
+} // namespace boost
+
+#define BOOST_STOPWATCHES_TIME_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_STOPWATCHES_TIME_FORMAT_DEFAULT)
+#ifdef __GNUC__
+#define BOOST_STOPWATCHES_TIME_FUNCTION_FORMAT boost::chrono::time_formatter::format(BOOST_CURRENT_FUNCTION)
+#else
+#define BOOST_STOPWATCHES_TIME_FUNCTION_FORMAT BOOST_STOPWATCHES_TIME_FORMAT(BOOST_CURRENT_FUNCTION)
+#endif
+
+#endif // BOOST_STOPWATCHES_TIME_FORMATTER_HPP
Added: sandbox/stopwatches/libs/chrono/stopwatches/Jamroot.jam
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/Jamroot.jam 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,9 @@
+
+import modules ;
+
+local boost = [ modules.peek : BOOST ] ;
+
+project sandbox : requirements <include>$(boost) ;
+
+# This seems to prevent some Boost.Build errors that otherwise occur :-(
+use-project /boost : $(boost) ;
Added: sandbox/stopwatches/libs/chrono/stopwatches/boost-build.jam
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/boost-build.jam 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,72 @@
+# Copyright Rene Rivera 2007.
+#
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+# For instructions see Jamfile.v2, or "bjam --help".
+
+local rule if-has-file ( file + : dir * )
+{
+ local result ;
+ if $(dir)
+ {
+ result = [ GLOB $(dir) : $(file) ] ;
+ }
+ return $(result[1]:P) ;
+}
+
+#~ Attempts to find the Boost source tree...
+
+local boost-src = [ if-has-file LICENSE_1_0.txt :
+ [ MATCH --boost=(.*) : $(ARGV) ]
+ $(BOOST)
+ $(BOOST_ROOT)
+ $(.boost-build-file:D)/../boost
+ $(.boost-build-file:D)/../Trunk
+ ] ;
+
+# error handling:
+if ! $(boost-src)
+{
+ ECHO Unable to find the Boost source tree in the locations searched. ;
+ ECHO Try setting the environment variable BOOST to point to your ;
+ ECHO Boost tree, or else invoke bjam with the --boost=path option. ;
+ ECHO The Boost include path will not be automatically set. ;
+ ECHO The paths searched were [ MATCH --boost=(.*) : $(ARGV) ] $(BOOST) $(.boost-build-file:D)/../boost $(.boost-build-file:D)/../Trunk ;
+ ECHO But the file LICENSE_1_0.txt was not found in any of them ;
+}
+
+#~ Attempts to find the Boost.Build files...
+
+local boost-build-src = [ if-has-file bootstrap.jam :
+ [ MATCH --boost-build=(.*) : $(ARGV) ]
+ $(BOOST_BUILD_PATH)
+ $(BOOST_BUILD)
+ $(boost-src)/tools/build/v2
+ ] ;
+
+# error handling:
+if ! $(boost-build-src)
+{
+ ECHO Unable to find the Boost.Build source tree in the locations searched. ;
+ ECHO Try setting the environment variable BOOST_BUILD to point to your ;
+ ECHO Boost.Build tree, or else invoke bjam with the --boost-build=path option. ;
+ ECHO The paths searched were [ MATCH --boost-build=(.*) : $(ARGV) ] $(BOOST_BUILD_PATH) $(BOOST_BUILD) $(boost-src)/tools/build/v2 ;
+ ECHO But bootstrap.jam was not found in any of these ;
+ ECHO More failures will very likely follow... ;
+}
+
+#~ Set some common vars to refer to the Boost sources...
+
+BOOST ?= $(boost-src) ;
+BOOST_ROOT ?= $(boost-src) ;
+
+#~ And load up Boost.Build...
+
+boost-build $(boost-build-src) ;
+
+
+
+
+
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/Jamfile.v2 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,103 @@
+# Boost.Chrono.Stopwatches library documentation Jamfile ---------------------------------
+#
+# Copyright Vicente J. Botet Escriba 2009-2011. Use, modification and
+# distribution is subject to the Boost Software License, Version
+# 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+# See http://www.boost.org for updates, documentation, and revision history.
+
+#import doxygen ;
+import os ;
+import quickbook ;
+
+#local boost-root = [ os.environ BOOST ] ;
+path-constant boost-root : [ modules.peek : BOOST ] ;
+
+path-constant images_location : html ;
+
+#doxygen autodoc
+# :
+# [ glob ../../../boost/chrono/*.hpp ]
+# [ glob ../../../boost/chrono/allocators/*.hpp ]
+# :
+# <doxygen:param>EXTRACT_ALL=NO
+# <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+# <doxygen:param>EXTRACT_PRIVATE=NO
+# <doxygen:param>EXPAND_ONLY_PREDEF=YES
+# <doxygen:param>PREDEFINED=BOOST_INTERPROCESS_DOXYGEN_INVOKED
+# <xsl:param>"boost.doxygen.reftitle=Boost.Chrono Reference"
+# ;
+
+xml stopwatches : stopwatches.qbk ;
+
+boostbook standalone
+ :
+ stopwatches
+ :
+ # HTML options first:
+ # Use graphics not text for navigation:
+ <xsl:param>navig.graphics=1
+ # How far down we chunk nested sections, basically all of them:
+ <xsl:param>chunk.section.depth=1
+ # Don't put the first section on the same page as the TOC:
+ <xsl:param>chunk.first.sections=1
+ # How far down sections get TOC's
+ <xsl:param>toc.section.depth=4
+ # Max depth in each TOC:
+ <xsl:param>toc.max.depth=2
+ # How far down we go with TOC's
+ <xsl:param>generate.section.toc.level=10
+ # Path for links to Boost:
+ #<xsl:param>boost.root=../../../..
+ # Path for libraries index:
+ #<xsl:param>boost.libraries=../../../../libs/libraries.htm
+ # Use the main Boost stylesheet:
+ #<xsl:param>html.stylesheet=../../../../doc/src/boostbook.css
+
+ # PDF Options:
+ # TOC Generation: this is needed for FOP-0.9 and later:
+ <format>pdf:<xsl:param>fop1.extensions=0
+ # Or enable this if you're using XEP:
+ <format>pdf:<xsl:param>xep.extensions=1
+ # TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
+ <format>pdf:<xsl:param>fop.extensions=0
+ # No indent on body text:
+ <xsl:param>body.start.indent=0pt
+ # Margin size:
+ <xsl:param>page.margin.inner=0.5in
+ # Margin size:
+ <xsl:param>page.margin.outer=0.5in
+ # Yes, we want graphics for admonishments:
+ <xsl:param>admon.graphics=1
+ # Set this one for PDF generation *only*:
+ # default pnd graphics are awful in PDF form,
+ # better use SVG's instead:
+ <format>pdf:<xsl:param>admon.graphics.extension=".svg"
+ <format>pdf:<xsl:param>admon.graphics.path=$(boost-images)
+ <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/chrono/stopwatches/doc/html
+
+ <dependency>css
+ <dependency>png
+ #<dependency>svg
+
+ ;
+
+
+install pdf-install : standalone : <location>. <install-type>PDF ;
+
+install css :
+ $(boost-root)/doc/src/boostbook.css :
+ <location>html
+ ;
+
+install png :
+ [ glob $(boost-root)/doc/src/images/*.png ] :
+ <location>html/images
+ ;
+
+install svg :
+ [ glob $(boost-root)/doc/src/images/*.svg ] :
+ <location>html/images
+ ;
+
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/appendices.html
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/appendices.html 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,1025 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Appendices</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
+<link rel="home" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="up" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="prev" href="reference.html" title="Reference">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="reference.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_chrono_stopwatches.appendices"></a><a class="link" href="appendices.html" title="Appendices">Appendices</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.history">Appendix
+ A: History</a></span></dt>
+<dd><dl>
+<dt><span class="section">Version 0.3.0, September 6, 2011 </span></dt>
+<dt><span class="section">Version 0.2.0, Feb 6, 2011 </span></dt>
+<dt><span class="section">Version 0.1.0, September 10, 2010 </span></dt>
+</dl></dd>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.rationale">Appendix
+ B: Rationale</a></span></dt>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.implementation">Appendix
+ C: Implementation Notes</a></span></dt>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.faq">Appendix D:
+ FAQ</a></span></dt>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.acknowledgements">Appendix
+ E: Acknowledgements</a></span></dt>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.tests">Appendix F:
+ Tests</a></span></dt>
+<dd><dl><dt><span class="section">stopwatch</span></dt></dl></dd>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.tickets">Appendix
+ G: Tickets</a></span></dt>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.perf">Appendix H:
+ Performances</a></span></dt>
+<dt><span class="section"><a href="appendices.html#boost_chrono_stopwatches.appendices.todo">Appendix I:
+ Future plans</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.history"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.history" title="Appendix A: History">Appendix
+ A: History</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Version 0.3.0, September 6, 2011 </span></dt>
+<dt><span class="section">Version 0.2.0, Feb 6, 2011 </span></dt>
+<dt><span class="section">Version 0.1.0, September 10, 2010 </span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.appendices.history.__version_0_3_0__september_6__2011__"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.history.__version_0_3_0__september_6__2011__" title="Version 0.3.0, September 6, 2011"><span class="bold"><strong>Version 0.3.0, September 6, 2011</strong></span> </a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Reinsertion of Boost.Stopwatches as a sub-library of Boost.Chrono.
+ </li>
+<li class="listitem">
+ Rename boost::stopwatches namespace to boost::chrono
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.appendices.history.__version_0_2_0__feb_6__2011__"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.history.__version_0_2_0__feb_6__2011__" title="Version 0.2.0, Feb 6, 2011"><span class="bold"><strong>Version 0.2.0, Feb 6, 2011</strong></span> </a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ Adaptation to new Boost.Chrono interface.
+ </li></ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.appendices.history.__version_0_1_0__september_10__2010__"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.history.__version_0_1_0__september_10__2010__" title="Version 0.1.0, September 10, 2010"><span class="bold"><strong>Version 0.1.0, September 10, 2010</strong></span> </a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ Extraction from Boost.Chrono of Boost.Stopwatches
+ </li></ul></div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.rationale"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.rationale" title="Appendix B: Rationale">Appendix
+ B: Rationale</a>
+</h3></div></div></div>
+<a name="boost_chrono_stopwatches.appendices.rationale.how_reliable_are_these_measures_"></a><h5>
+<a name="idp19640320"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.rationale.how_reliable_are_these_measures_">How
+ reliable are these measures?</a>
+ </h5>
+<p>
+ There are three cases which can lead to get unreliable measures:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ It is not possible to measure events that transpire at rates of the same
+ order of magnitude as the clock's precision with any reliability. For
+ example, a 10ms clock cannot be used reliably to measure elapsed times
+ of tens of milliseconds. The library provides a [high_resolution_clock]
+ that gives you the highest resolution time available on your platform.
+ That will give the best precision, but can only be used for reliable
+ measurement of events that elapse about an order of magnitude slower
+ than that clock's precision.
+ </li></ul></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+ <span class="special">...</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><</span> <code class="computeroutput"><span class="identifier">high_resolution_clock</span></code><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Using a process clock in a multithreaded application will give elapsed
+ time for the process as a whole, including threads other than the calling
+ thread. To get time elapsed for a specific thread, use the supplied
+ <code class="computeroutput"><span class="identifier">thread_clock</span></code> which returns
+ time elapsed for the calling thread only, if supported by the platform.
+ </li>
+<li class="listitem">
+ When stopclocks are nested, usually from stopclocks appearing in each
+ of several nested function calls, the overhead of the stopclock processing
+ begins to be significant relative to run time of the code being measured.
+ The innermost measurements remain accurate, but those in the outermost
+ layers can measure too much overhead to be trustworthy.
+ </li>
+<li class="listitem">
+ Nested stopclocks (usually nested function calls where each function
+ contains a stopclock). When the nesting is deep enough, the cumulative
+ overhead of all the stopclock functionality make the data unreliable
+ except for the inner-most trace points. The question is, how much time
+ is related to the application code we want to measure and how much to
+ the fact we are meassuring and logging in inner blocks?
+ </li>
+</ul></div>
+<p>
+ Most of the stopclock overhead is likely due to logging. There are two things
+ we can do to make the difference :
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Don't flush log information while measuring elapsed time. A <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a> can make
+ that possible, because it don't report until all the measures have been
+ compiled and then report some statistics. Alternatively, an asynchronous
+ stream would permit normal logging but by a thread other than the one
+ being measured.
+ </li>
+<li class="listitem">
+ Add a mechanism to track the difference between the application time
+ and stopclock time. If a <code class="computeroutput"><span class="identifier">Clock</span></code>
+ models <a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req" title="SuspendibleClock Requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a> and its precision
+ is sufficiently fine, this mechanism could suspend the <code class="computeroutput"><span class="identifier">Clock</span></code>'s counting while reporting measurements
+ and resume it thereafter.
+ </li>
+</ul></div>
+</div>
+<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.implementation"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.implementation" title="Appendix C: Implementation Notes">Appendix
+ C: Implementation Notes</a>
+</h3></div></div></div></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.faq"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.faq" title="Appendix D: FAQ">Appendix D:
+ FAQ</a>
+</h3></div></div></div>
+<a name="boost_chrono_stopwatches.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_clock_has_nanosecond_precision_"></a><h5>
+<a name="idp19674592"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_clock_has_nanosecond_precision_">Why
+ does stopwatch_reporter only display millisecond place precision when the
+ underlying Clock has nanosecond precision?</a>
+ </h5>
+<p>
+ To avoid giving the impression of precision where none exists. See Caveat
+ emptor. You can always specify additional decimal places if you want to live
+ dangerously.
+ </p>
+<a name="boost_chrono_stopwatches.appendices.faq.why_does_stopwatch_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_"></a><h5>
+<a name="idp19675424"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.faq.why_does_stopwatch_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_">Why
+ does stopwatch_reporter sometimes report more cpu seconds than real seconds?</a>
+ </h5>
+<p>
+ Ask your operating system supplier. The results have been inspected with
+ a debugger, and both for Windows and Linux, that's what the OS appears to
+ be reporting at times.
+ </p>
+<a name="boost_chrono_stopwatches.appendices.faq.can_i_obtain_statistics_of_the_time_elapsed_between_calls_to_a_function_"></a><h5>
+<a name="idp19680880"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.faq.can_i_obtain_statistics_of_the_time_elapsed_between_calls_to_a_function_">Can
+ I obtain statistics of the time elapsed between calls to a function?</a>
+ </h5>
+<p>
+ The library does not provides this feature.
+ </p>
+<a name="boost_chrono_stopwatches.appendices.faq.what_happens_if_i_press_ctrl_c_and_program_terminates__what_log_would_boost_stopwatches_output_"></a><h5>
+<a name="idp19684048"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.faq.what_happens_if_i_press_ctrl_c_and_program_terminates__what_log_would_boost_stopwatches_output_">What
+ happens if I press Ctrl+C and program terminates? What log would Boost.Stopwatches
+ output?</a>
+ </h5>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.acknowledgements"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.acknowledgements" title="Appendix E: Acknowledgements">Appendix
+ E: Acknowledgements</a>
+</h3></div></div></div>
+<p>
+ The library's started from the Beman Dawes <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code>, <code class="computeroutput"><span class="identifier">process_clock</span></code>,
+ <code class="computeroutput"><span class="identifier">process_timer</span></code>, <code class="computeroutput"><span class="identifier">run_timer</span></code> classes which are now deprecated
+ and replaced by the <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>, <code class="computeroutput"><span class="identifier">process_cpu_clock</span></code>
+ and <code class="computeroutput"><span class="identifier">stopclock</span></code> classes.
+ </p>
+<p>
+ Thanks to Adrew Chinoff for its multiple suggestion on <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a>, and helping
+ me to polish the documentation.
+ </p>
+<p>
+ Thanks to Tom Tan for reporting some compiler issues with MSVC V10 beta and
+ MinGW-gcc-4.4.0 and for the many suggestion he did concerning the <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>, <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch" title="Template Class lightweight_stopwatch<>"><code class="computeroutput"><span class="identifier">lightweight_stopwatch</span></code></a>, and <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a> classes and a deep help
+ with wide characters implementation.
+ </p>
+<p>
+ Thanks to Ronald Bock for reporting Valgind issues and for the many suggestion
+ he did concerning the documentation.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.tests"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.tests" title="Appendix F: Tests">Appendix F:
+ Tests</a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">stopwatch</span></dt></dl></div>
+<p>
+ In order to test you need to do.
+ </p>
+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">libs</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">test</span>
+</pre>
+<p>
+ You can also run a specific suite of test by doing
+ </p>
+<pre class="programlisting"><span class="identifier">cd</span> <span class="identifier">libs</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">test</span>
+<span class="identifier">bjam</span> <span class="identifier">stopwatch</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.appendices.tests.stopwatch"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.tests.stopwatch" title="stopwatch">stopwatch</a>
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ test_min_max
+ </p>
+ </td>
+<td>
+ <p>
+ compile
+ </p>
+ </td>
+<td>
+ <p>
+ test compilation succeeds in the presence of macros min and max.
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ stopwatch_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ scoped_stopwatch_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ stopwatch_accumulator_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ specific_stopwatch_accumulator_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ stopclock_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ stopclock_accumulator_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ nested_stopclock_accumulator_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ loop_stopclock_accumulator_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ t24_hours_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ scoped_stopclock_example
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ timex
+ </p>
+ </td>
+<td>
+ <p>
+ link
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ stopclock_constructor_overload_test
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ wstopclock_constructor_overload_test
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ ...
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.tickets"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.tickets" title="Appendix G: Tickets">Appendix
+ G: Tickets</a>
+</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Resolution
+ </p>
+ </th>
+<th>
+ <p>
+ State
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ 1
+ </p>
+ </td>
+<td>
+ <p>
+ suspend doesn't works: partial_ not initialized
+ </p>
+ </td>
+<td>
+ <p>
+ initialize with duration::zero()
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 2
+ </p>
+ </td>
+<td>
+ <p>
+ suspend doesn't works: elapsed doesn't take care of partial_
+ </p>
+ </td>
+<td>
+ <p>
+ take care of partial
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 3
+ </p>
+ </td>
+<td>
+ <p>
+ suspend doesn't works: bad use of system::error_code & ec
+ </p>
+ </td>
+<td>
+ <p>
+ replace by system::error_code ec
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 4
+ </p>
+ </td>
+<td>
+ <p>
+ Use of Specific formatters doesn't works
+ </p>
+ </td>
+<td>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 5
+ </p>
+ </td>
+<td>
+ <p>
+ boost/chrono/scoped_suspend.hpp(31) : warning C4520: 'boost::chrono::scoped_suspend<Clock>'
+ : multiple default constructors specified
+ </p>
+ </td>
+<td>
+ <p>
+ Remove the default constructor deletion
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 6
+ </p>
+ </td>
+<td>
+ <p>
+ suspendible_clock_test doesn't works in my mingw environement
+ </p>
+ </td>
+<td>
+ <p>
+ (issue with tss)
+ </p>
+ </td>
+<td>
+ <p>
+ <span class="bold"><strong>Open</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 7
+ </p>
+ </td>
+<td>
+ <p>
+ error_code not initialized
+ </p>
+ </td>
+<td>
+ <p>
+ Use ec.clear() before throwing a exception.
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 8
+ </p>
+ </td>
+<td>
+ <p>
+ Valgrind issue: Conditional jump or move depends on uninitialised
+ value(s)
+ </p>
+ </td>
+<td>
+ <p>
+ Replace the test
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.perf"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.perf" title="Appendix H: Performances">Appendix H:
+ Performances</a>
+</h3></div></div></div>
+<p>
+ We have run some program changing how the reporting is done.
+ </p>
+<p>
+ NONE: no report is done on the inner function HIGH: every call to the recursive
+ function is reported using an stopclock SUSPEND: every call to the recursive
+ function is reported using a using an stopclock on a suspendible clock ACCU:
+ every call to the recursive function is tracked using a stopclock_accumulator
+ </p>
+<p>
+ We have run the programm with two different clocks, high_resolution_clock
+ and thread_clock.
+ </p>
+<p>
+ The programs are either single-threaded or multi-threaded.
+ </p>
+<p>
+ Two kind of inner functions are used: recursive or non recursive. In order
+ to test the influence of nesting reports, the non recursive functions use
+ up to 10 nesting levels, depending on its parameter.
+ </p>
+<p>
+ the function at level n is defined as follows
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">fn</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">v</span><span class="special">)</span> <span class="special">{</span>
+ <span class="comment">// reporting or not
+</span> <span class="identifier">stopclock</span><span class="special"><></span> <span class="identifier">_</span><span class="special">;</span>
+ <span class="comment">// burn some time
+</span> <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">v</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">res</span><span class="special">+=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="identifier">res</span><span class="special">+</span><span class="number">123.456L</span><span class="special">+</span><span class="identifier">i</span> <span class="special">);</span> <span class="comment">// burn some time
+</span> <span class="keyword">if</span> <span class="special">(</span><span class="identifier">v</span><span class="special">==</span><span class="number">0</span><span class="special">)</span> <span class="keyword">return</span><span class="special">;</span>
+
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">v</span><span class="special">%(</span><span class="identifier">n</span><span class="special">-</span><span class="number">1</span><span class="special">)==</span><span class="number">0</span><span class="special">)</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">1</span><span class="special">(</span><span class="identifier">v</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">v</span><span class="special">%(</span><span class="identifier">n</span><span class="special">-</span><span class="number">2</span><span class="special">)==</span><span class="number">0</span><span class="special">)</span> <span class="identifier">fn</span><span class="special">-</span><span class="number">2</span><span class="special">(</span><span class="identifier">v</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+ <span class="special">...</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="identifier">v</span><span class="special">-</span><span class="number">1</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ This gives a variable number in nesting reporting depending on the parameter,
+ with a variable lifetime.
+ </p>
+<a name="boost_chrono_stopwatches.appendices.perf.single_threaded_recursive_function"></a><h5>
+<a name="idp19885856"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.perf.single_threaded_recursive_function">Single-Threaded
+ Recursive function</a>
+ </h5>
+<p>
+ We have run the same program and changed how the reporting is done.
+ </p>
+<p>
+ The programm creates two thread of execution. the thread entry point calls
+ a function which makes some calculation depending on its parameter and call
+ recursivelly itself decreasing the parameter.
+ </p>
+<p>
+ NONE: no report is done on the inner function HIGH: every call to the recursive
+ function is reported using an stopclock SUSPEND: every call to the recursive
+ function is reported using a using an stopclock on a suspendible clock ACCU:
+ every call to the recursive function is tracked using a stopclock_accumulator
+ </p>
+<p>
+ We have run the programm with two different clocks, high_resolution_clock
+ and thread_clock.
+ </p>
+<a name="boost_chrono_stopwatches.appendices.perf.multi_threaded_recursive_function"></a><h5>
+<a name="idp19890528"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.perf.multi_threaded_recursive_function">Multi-Threaded
+ Recursive function</a>
+ </h5>
+<p>
+ We have run the same program and changed how the reporting is done.
+ </p>
+<p>
+ The programm creates two thread of execution. the thread entry point calls
+ a function which makes some calculation depending on its parameter and call
+ recursivelly itself decreasing the parameter.
+ </p>
+<p>
+ NONE: no report is done on the inner function HIGH: every call to the recursive
+ function is reported using an stopclock SUSPEND: every call to the recursive
+ function is reported using a using an stopclock on a suspendible clock ACCU:
+ every call to the recursive function is tracked using a stopclock_accumulator
+ </p>
+<p>
+ We have run the programm with two different clocks, high_resolution_clock
+ and thread_clock.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.appendices.todo"></a><a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.todo" title="Appendix I: Future plans">Appendix I:
+ Future plans</a>
+</h3></div></div></div>
+<a name="boost_chrono_stopwatches.appendices.todo.tasks_to_do"></a><h5>
+<a name="idp19897008"></a>
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.todo.tasks_to_do">Tasks
+ to do</a>
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Complete documentation
+ </li>
+<li class="listitem">
+ Fully implement error handling, with test cases.
+ </li>
+<li class="listitem">
+ Fix open isues.
+ </li>
+</ul></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 -2011 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="reference.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
+</div>
+</body>
+</html>
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/overview.html
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/overview.html 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,210 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Overview</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
+<link rel="home" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="up" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="prev" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="next" href="users_guide.html" title="Users'Guide">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="users_guide.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_chrono_stopwatches.overview"></a><a class="link" href="overview.html" title="Overview">Overview</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Motivation</span></dt>
+<dt><span class="section">Description</span></dt>
+</dl></div>
+<a name="boost_chrono_stopwatches.overview.how_to_use_this_documentation"></a><h4>
+<a name="idp13414784"></a>
+ <a class="link" href="overview.html#boost_chrono_stopwatches.overview.how_to_use_this_documentation">How
+ to Use This Documentation</a>
+ </h4>
+<p>
+ This documentation makes use of the following naming and formatting conventions.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Code is in <code class="computeroutput"><span class="identifier">fixed</span> <span class="identifier">width</span>
+ <span class="identifier">font</span></code> and is syntax-highlighted.
+ </li>
+<li class="listitem">
+ Replaceable text that you will need to supply is in <em class="replaceable"><code>italics</code></em>.
+ </li>
+<li class="listitem">
+ Free functions are rendered in the code font followed by (), as in <code class="computeroutput"><span class="identifier">free_function</span><span class="special">()</span></code>.
+ </li>
+<li class="listitem">
+ If a name refers to a class template, it is specified like this: <code class="computeroutput"><span class="identifier">class_template</span><span class="special"><></span></code>;
+ that is, it is in code font and its name is followed by <code class="computeroutput"><span class="special"><></span></code>
+ to indicate that it is a class template.
+ </li>
+<li class="listitem">
+ If a name refers to a function-like macro, it is specified like this:
+ <code class="computeroutput"><span class="identifier">MACRO</span><span class="special">()</span></code>;
+ that is, it is uppercase in code font and its name is followed by <code class="computeroutput"><span class="special">()</span></code> to indicate that it is a function-like
+ macro. Object-like macros appear without the trailing <code class="computeroutput"><span class="special">()</span></code>.
+ </li>
+<li class="listitem">
+ Names that refer to <span class="emphasis"><em>concepts</em></span> in the generic programming
+ sense are specified in CamelCase.
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ In addition, notes such as this one specify non-essential information that
+ provides additional background or rationale.
+ </p></td></tr>
+</table></div>
+<p>
+ Finally, you can mentally add the following to any code fragments in this document:
+ </p>
+<pre class="programlisting"><span class="comment">// Include all of Stopwatches files
+</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.overview.motivation"></a><a class="link" href="overview.html#boost_chrono_stopwatches.overview.motivation" title="Motivation">Motivation</a>
+</h3></div></div></div>
+<a name="boost_chrono_stopwatches.overview.motivation.measuring_elapsed_time"></a><h5>
+<a name="idp13444944"></a>
+ <a class="link" href="overview.html#boost_chrono_stopwatches.overview.motivation.measuring_elapsed_time">Measuring
+ elapsed time</a>
+ </h5>
+<p>
+ Knowing how long a program, a function or a specific code block takes to
+ execute is useful in both test and production environments. <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span>
+ introduces the <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> concept which is a mechanism
+ to measure the elapsed time. A Stopwatch allows to start, stop, suspend and
+ resume measuring the elapsed time. <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ is the basic model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a>.
+ </p>
+<a name="boost_chrono_stopwatches.overview.motivation.reporting_elapsed_time"></a><h5>
+<a name="idp13453456"></a>
+ <a class="link" href="overview.html#boost_chrono_stopwatches.overview.motivation.reporting_elapsed_time">Reporting
+ elapsed time</a>
+ </h5>
+<p>
+ It is often necessary to report elapsed time on a user display or in a log
+ file. <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><> provides
+ a runtime reporting mechanism for this purpose which can be invoked in just
+ one line of code.
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+<p>
+ Will produce the following output
+ </p>
+<pre class="programlisting"><span class="identifier">real</span> <span class="number">0.034</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">cpu</span> <span class="number">0.031</span><span class="identifier">s</span> <span class="special">(</span><span class="number">93.0</span><span class="special">%),</span> <span class="identifier">user</span> <span class="number">0.031</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">system</span> <span class="number">0.000</span><span class="identifier">s</span>
+</pre>
+<p>
+ As this is one of the expression more commonly use, the library provides
+ a stopclock shortcut so the preceding can be writen as
+ </p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">_</span><span class="special">;</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+<a name="boost_chrono_stopwatches.overview.motivation.how_reliable_are_these_measures_"></a><h5>
+<a name="idp13489040"></a>
+ <a class="link" href="overview.html#boost_chrono_stopwatches.overview.motivation.how_reliable_are_these_measures_">How
+ reliable are these measures?</a>
+ </h5>
+<p>
+ There are a number of things that can lead to unreliable measurement (see
+ <a class="link" href="appendices.html#boost_chrono_stopwatches.appendices.rationale" title="Appendix B: Rationale">here</a>
+ for more details), but they mostly amount to reporting overhead. Boost.Chrono
+ provides two ways to improve reliability of time measurements. A <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a> only reports
+ statistics once all measurements have been acquired, which removes reporting
+ overhead from the measurements. The other approach is to use a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req" title="SuspendibleClock Requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a> such that the reporting
+ overhead can be ignored by suspending elapsed time tracking during reporting
+ operations
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.overview.description"></a><a class="link" href="overview.html#boost_chrono_stopwatches.overview.description" title="Description">Description</a>
+</h3></div></div></div>
+<p>
+ On top of the standard facilities of <span class="bold"><strong>Boost.Chrono</strong></span>,
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span> provides:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<p class="simpara">
+ Stopwatches: A facility to measure elapsed time with the ability to start,
+ stop, suspend, or resume measurement.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle">
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> concept
+ </li>
+<li class="listitem">
+ Scoped helper classes allowing to pairwise start/stop operations,
+ suspend/resume and resume/suspend a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a>.
+ </li>
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>, model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> capturing elapsed
+ <code class="computeroutput"><span class="identifier">Clock</span></code> times.
+ </li>
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a>, model
+ of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> capturing cummulated
+ elapsed Clock times.
+ </li>
+</ul></div>
+</li>
+<li class="listitem">
+<p class="simpara">
+ Stopclocks: a complete time reporting package that can be invoked in
+ a single line of code.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="circle">
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a>, convenient
+ reporting to an output stream (including wide char streams) of the
+ elapsed time of models of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> results.
+ </li>
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code></a>
+ shortcut of <code class="computeroutput"><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">>></span></code>
+ </li>
+</ul></div>
+</li>
+</ul></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 -2011 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="users_guide.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/reference.html
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/reference.html 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,3616 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Reference</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
+<link rel="home" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="up" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="prev" href="users_guide.html" title="Users'Guide">
+<link rel="next" href="appendices.html" title="Appendices">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="users_guide.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="appendices.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_chrono_stopwatches.reference"></a><a class="link" href="reference.html" title="Reference">Reference </a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches_stopwatches_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks">Other
+ clocks</a></span></dt>
+<dd><dl>
+<dt><span class="section">SuspendibleClock
Requirements</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_suspend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">suspendible_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section">Stopwatches</span></dt>
+<dd><dl>
+<dt><span class="section">Stopwatch
Requirements</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">lightweight_stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_scoped</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters">Stopwatch
+ Reporters</a></span></dt>
+<dd><dl>
+<dt><span class="section">Formatter
Requirements</span></dt>
+<dt><span class="section">Formatter
related traits</span></dt>
+<dt><span class="section">Reporter
Requirements</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_reporter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters">Stopwatch
+ Formatters</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches_hpp" title="Header <boost/chrono/stopwatches.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches_stopwatches_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches_stopwatches_hpp" title="Header <boost/chrono/stopwatches/stopwatches.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h3></div></div></div>
+<p>
+ This file include all the stopwatches related files except the suspendible
+ related files.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_reporter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_scoped</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks" title="Other clocks">Other
+ clocks</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">SuspendibleClock
Requirements</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspend">Static
+ Member Function <code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.resume">Static
+ Member Function <code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspended">Static
+ Member Function <code class="computeroutput"><span class="identifier">suspended</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_suspend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.is_suspendible">Meta
+ Function Class <code class="computeroutput"><span class="identifier">is_suspendible</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.scoped_suspend">Template
+ Class <code class="computeroutput"><span class="identifier">scoped_suspend</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">suspendible_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock">Template
+ Class <code class="computeroutput"><span class="identifier">suspendible_clock</span><span class="special"><></span></code></a></span></dt></dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req" title="SuspendibleClock Requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code> Requirements</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspend">Static
+ Member Function <code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.resume">Static
+ Member Function <code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspended">Static
+ Member Function <code class="computeroutput"><span class="identifier">suspended</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ A <code class="computeroutput"><span class="identifier">SuspendibleClock</span></code> is a
+ Clock that in addition supports <code class="computeroutput"><span class="identifier">suspend</span></code>/<code class="computeroutput"><span class="identifier">resume</span></code> operations.
+ </p>
+<p>
+ A <code class="computeroutput"><span class="identifier">SuspendibleClock</span></code> must
+ meet the requirements in the following Table.
+ </p>
+<p>
+ In this table <code class="computeroutput"><span class="identifier">C</span></code> denote
+ <code class="computeroutput"><span class="identifier">clock</span></code> types.
+ </p>
+<div class="table">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspendibleclock_requirements"></a><p class="title"><b>Table 1. SuspendibleClock Requirements</b></p>
+<div class="table-contents"><table class="table" summary="SuspendibleClock Requirements">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ expression
+ </p>
+ </th>
+<th>
+ <p>
+ return type
+ </p>
+ </th>
+<th>
+ <p>
+ operational semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C</span><span class="special">::</span><span class="identifier">suspend</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Suspends the time counting of the clock C.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C</span><span class="special">::</span><span class="identifier">resume</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Resumes the time counting of the clock C.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C</span><span class="special">::</span><span class="identifier">suspended</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Returns the delay(duration during which the clock has been suspended.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspend"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspend" title="Static Member Function suspend()">Static
+ Member Function <code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">suspend</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Suspends the SuspendibleClock.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>
+ function can throw. Otherwise <code class="computeroutput"><span class="identifier">ec</span></code>
+ is set with the correspoding error code set by <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.resume"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.resume" title="Static Member Function resume()">Static
+ Member Function <code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">resume</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Resumes the <code class="computeroutput"><span class="identifier">SuspendibleClock</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>
+ can throw. Otherwise <code class="computeroutput"><span class="identifier">ec</span></code>
+ is set with the correspoding error code set by <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspended"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req.suspended" title="Static Member Function suspended()">Static
+ Member Function <code class="computeroutput"><span class="identifier">suspended</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="identifier">suspended</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the cumalative elapsed duration
+ during which the <code class="computeroutput"><span class="identifier">SuspendibleClock</span></code>
+ has been suspendeed.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the Clock::now
+ function can throw if <code class="computeroutput"><span class="identifier">ec</span> <span class="special">==</span> <span class="identifier">throws</span><span class="special">()</span></code>. Otherwise <code class="computeroutput"><span class="identifier">ec</span></code>
+ is set with the correspoding error code set by <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>.
+ </p>
+</div>
+<p>
+ Models of <code class="computeroutput"><span class="identifier">SuspendibleClock</span></code>:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a>
+ </li></ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp" title="Header <boost/chrono/stopwatches/scoped_suspend.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_suspend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.is_suspendible">Meta
+ Function Class <code class="computeroutput"><span class="identifier">is_suspendible</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.scoped_suspend">Template
+ Class <code class="computeroutput"><span class="identifier">scoped_suspend</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">is_suspendible</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.is_suspendible"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.is_suspendible" title="Meta Function Class is_suspendible">Meta
+ Function Class <code class="computeroutput"><span class="identifier">is_suspendible</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">is_suspendible</span> <span class="special">:</span> <span class="identifier">mpl</span><span class="special">::</span> <span class="identifier">false_</span> <span class="special">{};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.scoped_suspend"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.scoped_suspend_hpp.scoped_suspend" title="Template Class scoped_suspend">Template
+ Class <code class="computeroutput"><span class="identifier">scoped_suspend</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">scoped_suspend</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">scoped_suspend</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">())</span> <span class="special">{}</span>
+ <span class="special">~</span><span class="identifier">scoped_suspend</span><span class="special">()</span> <span class="special">{}</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">scoped_suspend</span><span class="special">();</span> <span class="comment">// = delete;
+</span> <span class="identifier">scoped_suspend</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">scoped_suspend</span><span class="special">&);</span> <span class="comment">// = delete;
+</span> <span class="identifier">scoped_suspend</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">scoped_suspend</span><span class="special">&);</span> <span class="comment">// = delete;
+</span><span class="special">};</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp" title="Header <boost/chrono/stopwatches/suspendible_clock.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">suspendible_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock">Template
+ Class <code class="computeroutput"><span class="identifier">suspendible_clock</span><span class="special"><></span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">suspendible_clock</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">is_suspendible</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">>;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">scoped_suspend</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">>;</span>
+
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="Template Class suspendible_clock<>">Template
+ Class <code class="computeroutput"><span class="identifier">suspendible_clock</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock._scoped_suspend__specialization_for__suspendible_clock___"><code class="computeroutput"><span class="identifier">scoped_suspend</span></code> specialization for
+ <code class="computeroutput"><span class="identifier">suspendible_clock</span><span class="special"><></span></code></a></span></dt></dl></div>
+<p>
+ Given a <code class="computeroutput"><span class="identifier">Clock</span></code>, <a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a> < <code class="computeroutput"><span class="identifier">Clock</span></code>> is a model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req" title="SuspendibleClock Requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">suspendible_clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <code class="computeroutput"><span class="identifier">time_point</span></code><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">is_steady</span><span class="special">;</span>
+
+ <span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">suspend</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">resume</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">static</span> <span class="identifier">duration</span> <span class="identifier">suspended</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">());</span>
+<span class="special">};</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock._scoped_suspend__specialization_for__suspendible_clock___"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock._scoped_suspend__specialization_for__suspendible_clock___" title="scoped_suspend specialization for suspendible_clock<>"><code class="computeroutput"><span class="identifier">scoped_suspend</span></code> specialization for
+ <code class="computeroutput"><span class="identifier">suspendible_clock</span><span class="special"><></span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">scoped_suspend</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">scoped_suspend</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">());</span>
+ <span class="special">~</span><span class="identifier">scoped_suspend</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+</div>
+</div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches" title="Stopwatches">Stopwatches</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Stopwatch
Requirements</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.start">Member
+ Function <code class="computeroutput"><span class="identifier">start</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.stop">Member
+ Function <code class="computeroutput"><span class="identifier">stop</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.suspend">Member
+ Function <code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.resume">Member
+ Function <code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.restart">Member
+ Function <code class="computeroutput"><span class="identifier">restart</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.elapsed">Member
+ Function <code class="computeroutput"><span class="identifier">elapsed</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">lightweight_stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.dont_start_t">Class
+ <code class="computeroutput"><span class="identifier">dont_start_t</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch">Template
+ Class <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special"><></span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.spec"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a></span></dt>
+<dt><span class="section">stopwatch
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.spec"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a></span></dt>
+<dt><span class="section">stopwatch_accumulator
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_scoped</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_runner">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_runner</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_suspender">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_suspender</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_resumer">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_resumer</span><span class="special"><></span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code> Requirements</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.start">Member
+ Function <code class="computeroutput"><span class="identifier">start</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.stop">Member
+ Function <code class="computeroutput"><span class="identifier">stop</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.suspend">Member
+ Function <code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.resume">Member
+ Function <code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.restart">Member
+ Function <code class="computeroutput"><span class="identifier">restart</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.elapsed">Member
+ Function <code class="computeroutput"><span class="identifier">elapsed</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ A Stopwatch measure the amount of time elapsed from a start point in time
+ to the stop point time or the accumulation of them. Stopwatches can in
+ addition be restarted, suspended and resumed.
+ </p>
+<p>
+ A Stopwatch must meet the requirements in the following table. In this
+ table <code class="computeroutput"><span class="identifier">S</span></code>, <code class="computeroutput"><span class="identifier">S1</span></code> and <code class="computeroutput"><span class="identifier">S2</span></code>
+ denote Stopwatches types. <code class="computeroutput"><span class="identifier">s</span></code>
+ is an instance of <code class="computeroutput"><span class="identifier">S</span></code>.
+ </p>
+<div class="table">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.stopwatch_requirements"></a><p class="title"><b>Table 2. Stopwatch Requirements</b></p>
+<div class="table-contents"><table class="table" summary="Stopwatch Requirements">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ expression
+ </p>
+ </th>
+<th>
+ <p>
+ return type
+ </p>
+ </th>
+<th>
+ <p>
+ operational semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">clock</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ A model of <code class="computeroutput"><span class="identifier">Clock</span></code>.
+ </p>
+ </td>
+<td>
+ <p>
+ The clock associated to this Stopwatch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">clock</span><span class="special">::</span><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The <code class="computeroutput"><span class="identifier">duration</span></code>
+ type of the <code class="computeroutput"><span class="identifier">clock</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">clock</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The <code class="computeroutput"><span class="identifier">time_point</span></code>
+ type of the <code class="computeroutput"><span class="identifier">clock</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">scoped_run</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ RAI which <code class="computeroutput"><span class="identifier">start</span></code>/<code class="computeroutput"><span class="identifier">stop</span></code> the <code class="computeroutput"><span class="identifier">stopwatch</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">scoped_suspend</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ RAI which <code class="computeroutput"><span class="identifier">suspend</span></code>/<code class="computeroutput"><span class="identifier">resume</span></code> the <code class="computeroutput"><span class="identifier">stopwatch</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">scoped_resume</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">stopwatch_resumer</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ RAI which <code class="computeroutput"><span class="identifier">resume</span></code>/<code class="computeroutput"><span class="identifier">suspend</span></code> the <code class="computeroutput"><span class="identifier">stopwatch</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">start</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ starts a Stopwatch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">restart</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">S</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">S</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ restarts a Stopwatch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">stop</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ stops a Stopwatch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">resume</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ resume a Stopwatch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">suspend</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ suspends a Stopwatch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">s</span><span class="special">.</span><span class="identifier">elapsed</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ the elapsed time while the Stopwatch was running.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.start"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.start" title="Member Function start()">Member
+ Function <code class="computeroutput"><span class="identifier">start</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span> <span class="identifier">start</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Starts running the stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the starting time point.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.stop"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.stop" title="Member Function stop()">Member
+ Function <code class="computeroutput"><span class="identifier">stop</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="identifier">stop</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Stops running the stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> The cummulated elapsed time.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.suspend"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.suspend" title="Member Function suspend()">Member
+ Function <code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="identifier">suspend</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Suspends the stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.resume"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.resume" title="Member Function resume()">Member
+ Function <code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span> <span class="identifier">resume</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Resumes the stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the starting time point.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the Clock::now
+ function can throw.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.restart"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.restart" title="Member Function restart()">Member
+ Function <code class="computeroutput"><span class="identifier">restart</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span> <span class="identifier">restart</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> <code class="computeroutput"><span class="identifier">stop</span></code>/<code class="computeroutput"><span class="identifier">start</span></code> the stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the starting time point.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.elapsed"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req.elapsed" title="Member Function elapsed()">Member
+ Function <code class="computeroutput"><span class="identifier">elapsed</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="identifier">elapsed</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">())</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the cumulated elapsed time.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<p>
+ Models of <code class="computeroutput"><span class="identifier">Stopwatch</span></code>:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>
+ </li>
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a>
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp" title="Header <boost/chrono/stopwatches/lightweight_stopwatch.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">lightweight_stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.dont_start_t">Class
+ <code class="computeroutput"><span class="identifier">dont_start_t</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch">Template
+ Class <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special"><></span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">struct</span> <span class="identifier">dont_start_t</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">dont_start_t</span> <span class="identifier">dont_start</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">high_resolution_clock</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Features</span><span class="special">=</span><span class="keyword">void</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Weight</span><span class="special">=</span><span class="keyword">void</span>
+ <span class="special">></span> <span class="keyword">class</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch" title="Template Class lightweight_stopwatch<>"><code class="computeroutput"><span class="identifier">lightweight_stopwatch</span></code></a><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_lightweight_stopwatch</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">steady_lightweight_stopwatch</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_lightweight_stopwatch</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.dont_start_t"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.dont_start_t" title="Class dont_start_t">Class
+ <code class="computeroutput"><span class="identifier">dont_start_t</span></code></a>
+</h5></div></div></div>
+<p>
+ Structure used to don't start a <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span></code>
+ at construction time.
+ </p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">dont_start_t</span><span class="special">;</span>
+<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">dont_start_t</span> <span class="identifier">dont_start</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch" title="Template Class lightweight_stopwatch<>">Template
+ Class <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.c1">Constructor
+ <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span>
+ <span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.c2">Constructor
+ <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&,</span> <span class="identifier">dont_start_t</span>
+ <span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.get_storage">Member
+ Function <code class="computeroutput"><span class="identifier">get_storage</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.reset">Member
+ Function <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special"><></span></code> is a model of a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code> concept</a>.
+ </p>
+<p>
+ Knowing how long a part of a program takes to execute is useful in both
+ test and production environments. A <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch" title="Template Class lightweight_stopwatch<>"><code class="computeroutput"><span class="identifier">lightweight_stopwatch</span></code></a> object
+ measures elapsed time. It is recommended to use it with clocks that measure
+ wall clock rather than CPU time since the intended use is performance
+ measurement on systems where total elapsed time is more important than
+ just process or CPU time.
+ </p>
+<p>
+ The maximum measurable elapsed time depends on the Clock parameter. The
+ accuracy of timings depends on the accuracy of timing information provided
+ the Clock, and this could varies a great deal from one clock to another.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Features</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Weight</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">lightweight_stopwatch</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">storage</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&</span> <span class="identifier">st</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&</span> <span class="identifier">st</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">dont_start_t</span><span class="special">&</span> <span class="identifier">t</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">lightweight_stopwatch</span><span class="special">();</span>
+
+ <span class="identifier">time_point</span> <span class="identifier">start</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">duration</span> <span class="identifier">stop</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">></span> <span class="identifier">restart</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">duration</span> <span class="identifier">suspend</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">time_point</span> <span class="identifier">resume</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">duration</span> <span class="identifier">elapsed</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">storage</span><span class="special">&</span> <span class="identifier">get_storage</span><span class="special">(</span> <span class="special">);</span>
+ <span class="identifier">duration</span> <span class="identifier">lifetime</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">lightweight_stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">lightweight_stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_resumer</span><span class="special"><</span><span class="identifier">lightweight_stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+
+<span class="special">};</span>
+</pre>
+<p>
+ <code class="computeroutput"><span class="identifier">storage</span></code> is either <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span></code> if Features and Weight are
+ void and <code class="computeroutput"><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">accumulator_set</span><span class="special"><</span><span class="keyword">typename</span>
+ <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">Features</span><span class="special">,</span>
+ <span class="identifier">Weight</span><span class="special">></span></code>
+ otherwise.
+ </p>
+<p>
+ Only the specificities of this class are documented here. See <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code> concept</a> for the common
+ parts.
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.c1"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.c1" title="Constructor lightweight_stopwatch( storage&, system::error_code &)">Constructor
+ <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span>
+ <span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&</span> <span class="identifier">st</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> constructs and starts the
+ lightweight_stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.c2"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.c2" title="Constructor lightweight_stopwatch( storage&, dont_start_t &)">Constructor
+ <code class="computeroutput"><span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&,</span> <span class="identifier">dont_start_t</span>
+ <span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">lightweight_stopwatch</span><span class="special">(</span> <span class="identifier">storage</span><span class="special">&</span> <span class="identifier">st</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">dont_start_t</span><span class="special">&</span> <span class="identifier">t</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> constructs the lightweight_stopwatch
+ without starting it.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.get_storage"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.get_storage" title="Member Function get_storage()">Member
+ Function <code class="computeroutput"><span class="identifier">get_storage</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">storage</span><span class="special">&</span> <span class="identifier">get_storage</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the assocaited storage reference.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.reset"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch.reset" title="Member Function reset()">Member
+ Function <code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">reset</span><span class="special">(</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Stop the lightweight_stopwatch
+ and reinit the storage.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp" title="Header <boost/chrono/stopwatches/stopwatch.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.spec"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a></span></dt>
+<dt><span class="section">stopwatch
useful typedefs</span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">high_resolution_clock</span><span class="special">></span> <span class="keyword">class</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">wstopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">wstopwatch_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_stopwatch</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">steady_stopwatch</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_stopwatch</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch.c1">Constructor
+ <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special">(</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch.c2">Constructor
+ <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special">(</span>
+ <span class="identifier">dont_start_t</span> <span class="special">&)</span></code></a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code>
+ is a model of a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code> concept</a>.
+ </p>
+<p>
+ Knowing how long a part of a program takes to execute is useful in both
+ test and production environments. A <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a> object measures elapsed
+ time. It is recommended to use it with clocks that measure wall clock
+ rather than CPU time since the intended use is performance measurement
+ on systems where total elapsed time is more important than just process
+ or CPU time.
+ </p>
+<p>
+ The maximum measurable elapsed time depends on the Clock parameter. The
+ accuracy of timings depends on the accuracy of timing information provided
+ the Clock, and this could varies a great deal from one clock to another.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">stopwatch</span> <span class="special">:</span>
+ <span class="keyword">private</span> <span class="identifier">base_from_member</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>,</span>
+ <span class="keyword">public</span> <span class="identifier">lightweight_stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">dont_start_t</span><span class="special">&</span> <span class="identifier">t</span> <span class="special">);</span>
+
+<span class="special">};</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch.c1"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch.c1" title="Constructor stopwatch( system::error_code &)">Constructor
+ <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special">(</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">stopwatch</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> constructs and starts the
+ stopwatch.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span></code> function can throw when <code class="computeroutput"><span class="identifier">ec</span></code> is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch.c2"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch.c2" title="Constructor stopwatch( dont_start_t &)">Constructor
+ <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special">(</span>
+ <span class="identifier">dont_start_t</span> <span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">stopwatch</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">dont_start_t</span><span class="special">&</span> <span class="identifier">t</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> constructs the stopwatch without
+ starting it.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.spec"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.spec" title="stopwatch_reporter_default_formatter Specialization"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a>
+</h5></div></div></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ of a <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code>
+ is a <code class="computeroutput"><span class="identifier">stopwatch_formatter</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">wstopwatch_reporter_default_formatter</span></code>
+ of a <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code>
+ is a <code class="computeroutput"><span class="identifier">wstopwatch_formatter</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">wstopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">wstopwatch_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch_typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch_typedefs" title="stopwatch useful typedefs"><code class="computeroutput"><span class="identifier">stopwatch</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides stopwatch short cuts for all the models of <code class="computeroutput"><span class="identifier">Clock</span></code>, replacing clock by stopwatch.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span>
+ <span class="identifier">system_stopwatch</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">steady_clock</span> <span class="special">></span>
+ <span class="identifier">steady_stopwatch</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span>
+ <span class="identifier">high_resolution_stopwatch</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp" title="Header <boost/chrono/stopwatches/stopwatch_accumulator.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.spec"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a></span></dt>
+<dt><span class="section">stopwatch_accumulator
useful typedefs</span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Features</span><span class="special">=</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">features</span><span class="special"><</span>
+ <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
+ <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
+ <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">min</span><span class="special">,</span>
+ <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">max</span><span class="special">,</span>
+ <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">tag</span><span class="special">::</span><span class="identifier">mean</span> <span class="special">>,</span>
+ <span class="keyword">typename</span> <span class="identifier">Weight</span><span class="special">=</span><span class="keyword">void</span>
+ <span class="special">></span> <span class="keyword">class</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Accumulator</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Accumulator</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Accumulator</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">wstopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Accumulator</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">wstopwatch_accumulator_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">system_stopwatch_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">steady_stopwatch_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">high_resolution_stopwatch_accumulator</span><span class="special">;</span>
+
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator.c">Constructor
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special">()</span></code></a></span></dt></dl></div>
+<p>
+ A <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code> is a model of a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code> concept</a> that allows
+ to accumulate the time in several times instead of at once as it is the
+ case of the class <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Features</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Weight</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">stopwatch_accumulator</span>
+ <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">base_from_member</span><span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">accumulator_set</span><span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">Features</span><span class="special">,</span> <span class="identifier">Weight</span>
+ <span class="special">></span>
+ <span class="special">>,</span>
+ <span class="keyword">public</span> <span class="identifier">lightweight_stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span><span class="identifier">Features</span><span class="special">,</span><span class="identifier">Weight</span><span class="special">></span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">stopwatch_accumulator</span><span class="special">(</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator.c"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator.c" title="Constructor stopwatch_accumulator()">Constructor
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">stopwatch_accumulator</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Initialize the elapsed duration
+ and the times counter to 0. The stopwatch is not started.
+ </p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.spec"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.spec" title="stopwatch_reporter_default_formatter Specialization"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a>
+</h5></div></div></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ of a <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code> is a <code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Accumulator</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Accumulator</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">wstopwatch_reporter_default_formatter</span></code>
+ of a <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code> is a <code class="computeroutput"><span class="identifier">wstopwatch_accumulator_formatter</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Accumulator</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">wstopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Accumulator</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">wstopwatch_accumulator_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.typedefs" title="stopwatch_accumulator useful typedefs"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides stopwatch_accumulator shortcuts for all the models
+ of <code class="computeroutput"><span class="identifier">Clock</span></code>, replacing clock
+ by stopwatch_accumulator.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span>
+ <span class="identifier">system_stopwatch_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">steady_clock</span> <span class="special">></span>
+ <span class="identifier">steady_stopwatch_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span>
+ <span class="identifier">high_resolution_stopwatch_accumulator</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp" title="Header <boost/chrono/stopwatches/stopwatch_scoped.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_scoped</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_runner">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_runner</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_suspender">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_suspender</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_resumer">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_resumer</span><span class="special"><></span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_runner</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_suspender</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_resumer</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<p>
+ Boost.Chrono provides some helper classes ensuring pairwised operations
+ (start/stop, suspend/resume, resule/suspend).
+ </p>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_runner"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_runner" title="Template Class stopwatch_runner<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_runner</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ This helper class ensures that the start/stop are pairwised. Starts the
+ associated <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> at construction time,
+ and stops it at destruction time.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_runner</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special">(</span><span class="identifier">stopwatch</span> <span class="special">&</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">());</span>
+ <span class="special">~</span><span class="identifier">stopwatch_runner</span><span class="special">();</span>
+ <span class="identifier">stopwatch_runner</span><span class="special">()</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">stopwatch_runner</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">stopwatch_runner</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Usage
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f1</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_suspender"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_suspender" title="Template Class stopwatch_suspender<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_suspender</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ This helper class ensures that the suspend/resume are pairwised. Suspends
+ the associated <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> at construction time,
+ and resumes it at destruction time.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_suspender</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special">(</span><span class="identifier">stopwatch</span> <span class="special">&</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">());</span>
+ <span class="special">~</span><span class="identifier">stopwatch_suspender</span><span class="special">();</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special">()</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">stopwatch_suspender</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">stopwatch_suspender</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Usage
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f1</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="comment">// ...
+</span>
+ <span class="comment">// call to some function we don't want to measure
+</span> <span class="special">{</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">external_function</span><span class="special">();</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_resumer"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_scoped_hpp.stopwatch_resumer" title="Template Class stopwatch_resumer<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_resumer</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ This helper class ensures that the resume/suspend are pairwised. Resumes
+ the associated <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> at construction time,
+ and suspends it at destruction time.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_resumer</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="identifier">stopwatch_resumer</span><span class="special">(</span><span class="identifier">stopwatch</span> <span class="special">&</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">());</span>
+ <span class="special">~</span><span class="identifier">stopwatch_resumer</span><span class="special">();</span>
+ <span class="identifier">stopwatch_resumer</span><span class="special">()</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+ <span class="identifier">stopwatch_resumer</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">stopwatch_resumer</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+ <span class="identifier">stopwatch_resumer</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">stopwatch_resumer</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">delete</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Usage
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f1</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="comment">// ...
+</span>
+ <span class="comment">// call to some function we don't want to measure
+</span> <span class="special">{</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+
+ <span class="special">{</span>
+ <span class="identifier">stopwatch_resumer</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters" title="Stopwatch Reporters">Stopwatch
+ Reporters</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Formatter
Requirements</span></dt>
+<dt><span class="section">Formatter
related traits</span></dt>
+<dt><span class="section">Reporter
Requirements</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.R">Member
+ Function <code class="computeroutput"><span class="identifier">R</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.report">Member
+ Function <code class="computeroutput"><span class="identifier">report</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.reported">Member
+ Function <code class="computeroutput"><span class="identifier">reported</span><span class="special">()</span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_reporter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.basic_stopwatch_reporter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_reporter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.wstopwatch_reporter">Template
+ Class <code class="computeroutput"><span class="identifier">wstopwatch_reporter</span><span class="special"><></span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.basic_stopclock">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopclock</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock">Template
+ Class <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">stopclock
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.wstopclock">Template
+ Class <code class="computeroutput"><span class="identifier">wstopclock</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">wstopclock
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.basic_stopclock_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopclock_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">stopclock_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">stopclock_accumulator
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.wstopclock_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">wstopclock_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">wstopclock_accumulator
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock">Template
+ Class <code class="computeroutput"><span class="identifier">scoped_stopclock</span><span class="special"><></span></code></a></span></dt></dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.formatter_req"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.formatter_req" title="Formatter Requirements"><code class="computeroutput"><span class="identifier">Formatter</span></code> Requirements</a>
+</h4></div></div></div>
+<p>
+ A Formatter outputs on a given ostream a formatted string combining informations
+ from a Stopwatch and the format and the double precision.
+ </p>
+<p>
+ A Formatter must meet the requirements in the following Table.
+ </p>
+<p>
+ In this table <code class="computeroutput"><span class="identifier">F</span></code> denote
+ a Formatter type, <code class="computeroutput"><span class="identifier">S</span></code> is
+ a Stopwatch and <code class="computeroutput"><span class="identifier">s</span></code> is an
+ instance of <code class="computeroutput"><span class="identifier">S</span></code>, <code class="computeroutput"><span class="identifier">f</span></code> is <code class="computeroutput"><span class="keyword">const</span>
+ <span class="keyword">char</span> <span class="special">*</span></code>
+ , <code class="computeroutput"><span class="identifier">p</span></code> is and int, and <code class="computeroutput"><span class="identifier">os</span></code> is a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span></code>,
+ ec is a system::error_code
+ </p>
+<div class="table">
+<a name="boost_chrono_stopwatches.reference.reporters.formatter_req.formatter_requirements"></a><p class="title"><b>Table 3. Formatter Requirements</b></p>
+<div class="table-contents"><table class="table" summary="Formatter Requirements">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ expression
+ </p>
+ </th>
+<th>
+ <p>
+ return type
+ </p>
+ </th>
+<th>
+ <p>
+ operational semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">F</span><span class="special">::</span><span class="identifier">default_os</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ std::otream&
+ </p>
+ </td>
+<td>
+ <p>
+ The output stream.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">F</span><span class="special">::</span><span class="identifier">default_places</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The precision when displaying a double.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">F</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The default format.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">F</span><span class="special">::</span><span class="identifier">show_time</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">p</span><span class="special">,</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">S</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ outputs on <code class="computeroutput"><span class="identifier">os</span></code>
+ a formatted string combining informations from the Stopwatch
+ <code class="computeroutput"><span class="identifier">s</span></code>, the format
+ <code class="computeroutput"><span class="identifier">f</span></code> and the double
+ precision <code class="computeroutput"><span class="identifier">p</span></code>.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ Models of <code class="computeroutput"><span class="identifier">Formatter</span></code>:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp.basic_stopwatch_formatter" title="Template Class basic_stopwatch_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a>
+ </li>
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a>
+ </li>
+<li class="listitem">
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.basic_24_hours_formatter" title="Template Class basic_24_hours_formatter<>"><code class="computeroutput"><span class="identifier">basic_24_hours_formatter</span></code></a>
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters._formatter__related_traits"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters._formatter__related_traits" title="Formatter related traits"><code class="computeroutput"><span class="identifier">Formatter</span></code> related traits</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
+ defines the default formatter used by the <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a> class when
+ the <code class="computeroutput"><span class="identifier">Formatter</span></code> parameter
+ is not explicit.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.reporters_req"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req" title="Reporter Requirements"><code class="computeroutput"><span class="identifier">Reporter</span></code> Requirements</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.R">Member
+ Function <code class="computeroutput"><span class="identifier">R</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.report">Member
+ Function <code class="computeroutput"><span class="identifier">report</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.reported">Member
+ Function <code class="computeroutput"><span class="identifier">reported</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ A <code class="computeroutput"><span class="identifier">Reporter</span></code> provides everything
+ a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> provides and adds reporting
+ capabilities. The reporting is controleed by two parameters:
+ </p>
+<p>
+ A <code class="computeroutput"><span class="identifier">Reporter</span></code> must meet the
+ requirements in the following table in addition of the <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a>. The reporting is controleed
+ by two parameters:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ format : The output format
+ </li>
+<li class="listitem">
+ places(precision): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ And is sent to an output stream.
+ </p>
+<p>
+ In this table <code class="computeroutput"><span class="identifier">R</span></code> denote
+ Reporters types. <code class="computeroutput"><span class="identifier">r</span></code> is an
+ instance of <code class="computeroutput"><span class="identifier">R</span></code>, ec is a
+ system::error_code, os is an std::ostream, f is a std::string, p is an
+ int. From the library perspective a Reporter needs to satisfy the following
+ requirements.
+ </p>
+<div class="table">
+<a name="boost_chrono_stopwatches.reference.reporters.reporters_req.reporter_requirements"></a><p class="title"><b>Table 4. Reporter Requirements</b></p>
+<div class="table-contents"><table class="table" summary="Reporter Requirements">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ expression
+ </p>
+ </th>
+<th>
+ <p>
+ return type
+ </p>
+ </th>
+<th>
+ <p>
+ operational semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span><span class="special">::</span><span class="identifier">stopwatch</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ A model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a>.
+ </p>
+ </td>
+<td>
+ <p>
+ The Stopwatch associated to this Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">r</span><span class="special">.</span><span class="identifier">report</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a report.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">r</span><span class="special">.</span><span class="identifier">report</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a report.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">r</span><span class="special">.</span><span class="identifier">reported</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">bool</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The reporting has been done.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><p>
+ From the user point of view, the reporter provides often construction with
+ any of the parameters controleed the reporting.
+ </p>
+<div class="table">
+<a name="boost_chrono_stopwatches.reference.reporters.reporters_req.open_reporter_requirements"></a><p class="title"><b>Table 5. Open Reporter Requirements</b></p>
+<div class="table-contents"><table class="table" summary="Open Reporter Requirements">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ expression
+ </p>
+ </th>
+<th>
+ <p>
+ return type
+ </p>
+ </th>
+<th>
+ <p>
+ operational semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">f</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">p</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">p</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">p</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">p</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">f</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">p</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">p</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">p</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span> <span class="identifier">r</span><span class="special">(</span><span class="identifier">p</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">R</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Creates a Reporter.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<br class="table-break"><div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.reporters_req.R"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.R" title="Member Function R()">Member
+ Function <code class="computeroutput"><span class="identifier">R</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">R</span><span class="special">(</span>
+ <span class="special">[</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span> <span class="special">]</span>
+ <span class="special">[,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">]</span>
+ <span class="special">[,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">]</span>
+ <span class="special">[,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()]</span>
+ <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Creates a reporter. All the
+ parameters are optional.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.reporters_req.report"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.report" title="Member Function report()">Member
+ Function <code class="computeroutput"><span class="identifier">report</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">report</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">());</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Produce a report taking in account
+ the ostream, format and place.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the <code class="computeroutput"><span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">show_time</span><span class="special">(*</span><span class="keyword">this</span><span class="special">,</span><span class="identifier">f</span><span class="special">,</span><span class="identifier">p</span><span class="special">,</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">ec</span><span class="special">)</span></code>
+ function can throw when <code class="computeroutput"><span class="identifier">ec</span></code>
+ is <code class="computeroutput"><span class="identifier">throws</span><span class="special">()</span></code>.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.reporters_req.reported"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.reporters_req.reported" title="Member Function reported()">Member
+ Function <code class="computeroutput"><span class="identifier">reported</span><span class="special">()</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">reported</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> True if the reportes has ben
+ reported already.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp" title="Header <boost/chrono/stopwatches/stopwatch_reporter.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_reporter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.basic_stopwatch_reporter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_reporter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.wstopwatch_reporter">Template
+ Class <code class="computeroutput"><span class="identifier">wstopwatch_reporter</span><span class="special"><></span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">,</span>
+ <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span><span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">class</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">wstopwatch_reporter_default_formatter</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">,</span>
+ <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span><span class="keyword">typename</span> <span class="identifier">wstopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">wstopwatch_reporter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.basic_stopwatch_reporter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.basic_stopwatch_reporter" title="Template Class basic_stopwatch_reporter<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_reporter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ class <code class="computeroutput"><span class="identifier">basic_stopwatch_reporter</span></code>
+ provides everything a <code class="computeroutput"><span class="identifier">Stopwatch</span></code>
+ provides and it adds reporting capabilities that can be invoked in a
+ single line of code. The reporting is controleed by two parameters:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ format : The output format
+ </li>
+<li class="listitem">
+ places(precision): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ The default places is given by Formatter::default_places().
+ </p>
+<p>
+ The default format is given by Formatter::default_format().
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_stopwatch_reporter</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">Stopwatch</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Stopwatch</span><span class="special">::</span><span class="identifier">clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">basic_stopwatch_reporter</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">report</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">bool</span> <span class="identifier">reported</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_resumer</span><span class="special"><</span><span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ class <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a> provides
+ a everything a <code class="computeroutput"><span class="identifier">Stopwatch</span></code>
+ provides and it adds reporting capabilities that can be invoked in a
+ single line of code. The reporting is controleed by two parameters:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ format : The output format
+ </li>
+<li class="listitem">
+ places(precision): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ The default places is given by Formatter::default_places().
+ </p>
+<p>
+ The default format is given by Formatter::default_format().
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">stopwatch_reporter</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">,</span><span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Stopwatch</span><span class="special">::</span><span class="identifier">clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">stopwatch_reporter</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">report</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">bool</span> <span class="identifier">reported</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_resumer</span><span class="special"><</span><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Usage
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f1</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">accumulator</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">accumulator</span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">accumulator</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="comment">// ...
+</span>
+ <span class="comment">// call to some function we don't want to measure
+</span> <span class="special">{</span>
+ <span class="identifier">accumulator</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">external_function</span><span class="special">();</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.wstopwatch_reporter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.wstopwatch_reporter" title="Template Class wstopwatch_reporter<>">Template
+ Class <code class="computeroutput"><span class="identifier">wstopwatch_reporter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ class <code class="computeroutput"><span class="identifier">wstopwatch_reporter</span></code>
+ provides a everything a <code class="computeroutput"><span class="identifier">Stopwatch</span></code>
+ provides and it adds reporting capabilities that can be invoked in a
+ single line of code. The reporting is controleed by two parameters:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ format : The output format
+ </li>
+<li class="listitem">
+ places(precision): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ The default places is given by Formatter::default_places().
+ </p>
+<p>
+ The default format is given by Formatter::default_format().
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">wstopwatch_reporter</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_wstopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">,</span><span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Stopwatch</span><span class="special">::</span><span class="identifier">clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopwatch_reporter</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">wstopwatch_reporter</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">report</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">bool</span> <span class="identifier">reported</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_runner</span><span class="special"><</span><span class="identifier">wstopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_suspender</span><span class="special"><</span><span class="identifier">wstopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_resumer</span><span class="special"><</span><span class="identifier">wstopwatch_reporter</span><span class="special"><</span><span class="identifier">Stopwatch</span><span class="special">></span> <span class="special">></span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Usage
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f1</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">wstopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">accumulator</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">accumulator</span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">accumulator</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="comment">// ...
+</span>
+ <span class="comment">// call to some function we don't want to measure
+</span> <span class="special">{</span>
+ <span class="identifier">accumulator</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">external_function</span><span class="special">();</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp" title="Header <boost/chrono/stopwatches/stopclock.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.basic_stopclock">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopclock</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock">Template
+ Class <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">stopclock
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.wstopclock">Template
+ Class <code class="computeroutput"><span class="identifier">wstopclock</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">wstopclock
useful typedefs</span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">basic_stopclock</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span> <span class="keyword">class</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">wstopclock</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_stopclock</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">steady_stopclock</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_stopclock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_real_cpu_stopclock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_user_cpu_stopclock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_system_cpu_stopclock</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_wstopclock</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">steady_wstopclock</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_wstopclock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_real_cpu_wstopclock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_user_cpu_wstopclock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_system_cpu_wstopclock</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_hpp.basic_stopclock"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.basic_stopclock" title="Template Class basic_stopclock<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopclock</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">basic_stopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span><span class="identifier">Formatter</span><span class="special">></span></code>
+ template class is a shortcut of <code class="computeroutput"><span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span><span class="identifier">Formatter</span><span class="special">>></span></code>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_stopclock</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ A stopclock is a stopwatch with the ability to report elapsed time on
+ an output stream. <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code> template class is a shortcut of
+ <code class="computeroutput"><span class="identifier">basic_stopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span><span class="special">></span></code> with a specific default formatter.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span>
+ <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">process_cpu_clock</span>
+ <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span><span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span>
+<span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopclock</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_stopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopclock</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopclock</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.typedefs" title="stopclock useful typedefs"><code class="computeroutput"><span class="identifier">stopclock</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides stopclock shortcuts for all the models of <code class="computeroutput"><span class="identifier">Clock</span></code>, replacing clock by stopclock.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span>
+ <span class="identifier">system_stopwatch_stopclock</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">steady_clock</span> <span class="special">></span>
+ <span class="identifier">steady_stopwatch_stopclock</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span>
+ <span class="identifier">high_resolution_stopclock</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_real_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_real_cpu_stopclock</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_user_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_user_cpu_stopclock</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_system_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_system_cpu_stopclock</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_hpp.wstopclock"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.wstopclock" title="Template Class wstopclock<>">Template
+ Class <code class="computeroutput"><span class="identifier">wstopclock</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">wstopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code>
+ template class is a shortcut of <code class="computeroutput"><span class="identifier">basic_wstopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span><span class="special">></span></code> with a specific default formatter.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span>
+ <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">process_cpu_clock</span>
+ <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span><span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span>
+<span class="special">></span> <span class="keyword">class</span> <span class="identifier">wstopclock</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_wstopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">wstopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">wstopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_hpp.wtypedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.wtypedefs" title="wstopclock useful typedefs"><code class="computeroutput"><span class="identifier">wstopclock</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides wstopclock shortcuts for all the models of <code class="computeroutput"><span class="identifier">Clock</span></code>, replacing clock by wstopclock.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span>
+ <span class="identifier">system_wstopclock</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">steady_clock</span> <span class="special">></span>
+ <span class="identifier">steady_wstopclock</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span>
+ <span class="identifier">high_resolution_wstopclock</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_real_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_real_cpu_wstopclock</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_user_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_user_cpu_wstopclock</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_system_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_system_cpu_wstopclock</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp" title="Header <boost/chrono/stopwatches/stopclock_accumulator.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.basic_stopclock_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopclock_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">stopclock_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">stopclock_accumulator
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.wstopclock_accumulator">Template
+ Class <code class="computeroutput"><span class="identifier">wstopclock_accumulator</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">wstopclock_accumulator
useful typedefs</span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">basic_stopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span>
+ <span class="keyword">class</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">wstopclock_accumulator</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_stopclock_accumulator</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">steady_stopclock_accumulator</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_stopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_real_cpu_stopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_user_cpu_stopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_system_cpu_stopclock_accumulator</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_wstopclock_accumulator</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">steady_wstopclock_accumulator</span><span class="special">;</span>
+ <span class="preprocessor">#endif</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_wstopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_real_cpu_wstopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_user_cpu_wstopclock_accumulator</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_system_cpu_wstopclock_accumulator</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.basic_stopclock_accumulator"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.basic_stopclock_accumulator" title="Template Class basic_stopclock_accumulator<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopclock_accumulator</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">basic_stopclock_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code> template class is a shortcut of
+ <code class="computeroutput"><span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>,</span> <span class="keyword">typename</span>
+ <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span><span class="special">></span></code>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span>
+ <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">high_resolution_clock</span>
+ <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span>
+ <span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span>
+<span class="special">></span> <span class="keyword">class</span> <span class="identifier">basic_stopclock_accumulator</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">basic_stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>">Template
+ Class <code class="computeroutput"><span class="identifier">stopclock_accumulator</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">stopclock_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code> template class is a shortcut of
+ <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>></span></code>
+ with a specific formatter.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span>
+ <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">high_resolution_clock</span>
+ <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span>
+ <span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span>
+<span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopclock_accumulator</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_stopclock_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">stopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.typedefs" title="stopclock_accumulator useful typedefs"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides stopclock_accumulator shortcuts for all the models
+ of <code class="computeroutput"><span class="identifier">Clock</span></code>, replacing clock
+ by stopclock_accumulator.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span>
+ <span class="identifier">system_stopclock_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">steady_clock</span> <span class="special">></span>
+ <span class="identifier">steady_stopclock_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span>
+ <span class="identifier">high_resolution_stopclock_accumulator</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_real_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_real_cpu_stopclock_accumulator</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_user_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_user_cpu_stopclock_accumulator</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_system_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_system_cpu_stopclock_accumulator</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.wstopclock_accumulator"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.wstopclock_accumulator" title="Template Class wstopclock_accumulator<>">Template
+ Class <code class="computeroutput"><span class="identifier">wstopclock_accumulator</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">wstopclock_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code> template class is a shortcut of
+ <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>></span></code>
+ with a specific formatter.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span>
+ <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">high_resolution_clock</span>
+ <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span>
+ <span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span>
+<span class="special">></span> <span class="keyword">class</span> <span class="identifier">wstopclock_accumulator</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">basic_wstopclock_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">wstopclock_accumulator</span><span class="special">(</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.wtypedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.wtypedefs" title="wstopclock_accumulator useful typedefs"><code class="computeroutput"><span class="identifier">wstopclock_accumulator</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides wstopclock_accumulator shortcuts for all the models
+ of <code class="computeroutput"><span class="identifier">Clock</span></code>, replacing clock
+ by wstopclock_accumulator.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span>
+ <span class="identifier">system_wstopclock_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">steady_clock</span> <span class="special">></span>
+ <span class="identifier">steady_wstopclock_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span>
+ <span class="identifier">high_resolution_wstopclock_accumulator</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_real_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_real_cpu_wstopclock_accumulator</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_user_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_user_cpu_wstopclock_accumulator</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_system_cpu_clock</span> <span class="special">></span>
+ <span class="identifier">process_system_cpu_wstopclock_accumulator</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp" title="Header <boost/chrono/stopwatches/scoped_stopclock.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">scoped_stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock">Template
+ Class <code class="computeroutput"><span class="identifier">scoped_stopclock</span><span class="special"><></span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">scoped_stopclock</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock" title="Template Class scoped_stopclock<>">Template
+ Class <code class="computeroutput"><span class="identifier">scoped_stopclock</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">scoped_stopclock</span><span class="special"><></span></code>is
+ like a <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span></code>
+ but that in addition will output a scoped trace. At construction time
+ it will output
+ </p>
+<pre class="programlisting"><span class="special">{{{</span> <span class="special"><</span><span class="identifier">string</span><span class="special">></span>
+</pre>
+<p>
+ and at destruction time
+ </p>
+<pre class="programlisting"><span class="special">}}}</span> <span class="special"><</span><span class="identifier">string</span><span class="special">></span> <span class="special"><</span><span class="identifier">output</span> <span class="identifier">of</span> <span class="identifier">stopwatch_reporter</span><span class="special">></span>
+</pre>
+<p>
+ A typical ussage of this class is
+ </p>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">scoped_stopclock</span><span class="special"><></span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">BOOST_CURRENT_FUNCTION</span><span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<a name="boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock.synopsis"></a><h6>
+<a name="idp18591040"></a>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock.synopsis">Synopsis</a>
+ </h6>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">process_cpu_clock</span>
+ <span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span><span class="special">=</span><span class="keyword">typename</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>>::</span><span class="identifier">type</span>
+<span class="special">></span> <span class="keyword">class</span> <span class="identifier">scoped_stopclock</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>,</span> <span class="identifier">Formatter</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Stopwatch</span> <span class="identifier">stopwatch</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Formatter</span> <span class="identifier">formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">string_type</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">char_type</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Formatter</span><span class="special">::</span><span class="identifier">ostream_type</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="identifier">scoped_stopclock</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&</span> <span class="identifier">func</span><span class="special">,</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="keyword">const</span> <span class="identifier">string_type</span> <span class="special">&</span> <span class="identifier">format</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">throws</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">scoped_stopclock</span><span class="special">();</span>
+
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">scoped_run</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">scoped_suspend</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">scoped_resume</span> <span class="identifier">scoped_resume</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters" title="Stopwatch Formatters">Stopwatch
+ Formatters</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp.basic_stopwatch_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_formatter</span><span class="special"><></span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.typedefs"><code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span></code>
+ useful typedefs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.basic_time_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_time_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">basic_time_formatter
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.spec"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.basic_stopwatch_accumulator_time_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.typedefs"><code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span></code>
+ useful typedefs</a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_hpp.t24_hours">Class
+ <code class="computeroutput"><span class="identifier">t24_hours</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.basic_24_hours_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_24_hours_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">basic_24_hours_formatter
useful typedefs</span></dt>
+</dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp" title="Header <boost/chrono/stopwatches/stopwatch_formatter.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp.basic_stopwatch_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_formatter</span><span class="special"><></span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+ <span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">basic_stopwatch_formatter</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">stopwatch_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wstopwatch_formatter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp.basic_stopwatch_formatter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp.basic_stopwatch_formatter" title="Template Class basic_stopwatch_formatter<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_formatter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">stopwatch_formatter</span></code> is
+ a model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.formatter_req" title="Formatter Requirements"><code class="computeroutput"><span class="identifier">Formatter</span></code></a>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+<span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_stopwatch_formatter</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">></span> <span class="identifier">ostream_type</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">default_os</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span> <span class="identifier">default_format</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Stopwatch</span> <span class="special">></span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">show_time</span><span class="special">(</span> <span class="identifier">Stopwatch</span> <span class="special">&</span> <span class="identifier">stopwatch_</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The default places is given by default_places and is 3.
+ </p>
+<p>
+ The default format is "%ts\n", where
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">d</span></code>
+ : the result of elapsed() when the reporting is done.
+ </li></ul></div>
+<p>
+ The time is given using the suffix "s" following the System
+ International d'Unites Std.
+ </p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp" title="Header <boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.typedefs"><code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span></code>
+ useful typedefs</a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+ <span class="special">></span> <span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">stopwatch_accumulator_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wstopwatch_accumulator_formatter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span></code>
+ is a model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.formatter_req" title="Formatter Requirements"><code class="computeroutput"><span class="identifier">Formatter</span></code></a>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_stopwatch_accumulator_formatter</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">></span> <span class="identifier">ostream_type</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">default_os</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span> <span class="identifier">default_format</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span> <span class="special">></span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">show_time</span><span class="special">(</span> <span class="identifier">Stopwatch</span> <span class="special">&</span> <span class="identifier">stopwatch_</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The default places is given by default_places and is 3.
+ </p>
+<p>
+ The default format is "%c times, sum<code class="literal">%ss, min</code>%ms,
+ max<code class="literal">%Ms, mean</code>%as, frequency<code class="literal">%fHz, lifetime</code>%ls,
+ percentage=%p%\n", where
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
+ : the counter of the number of times the pair srat/stop has been
+ called.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : the sum of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">m</span></code>
+ : the min of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">M</span></code>
+ : the max of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">a</span></code>
+ : the mean of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">f</span></code>
+ : the frequency of calls to start.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">l</span></code>
+ : the lifetime of the stopwatch_accumulator.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">p</span></code>
+ : the percentage of time spent by this stopwatch respect to its lifetime.
+ </li>
+</ul></div>
+<p>
+ The time is given using the suffix "s", the frequency is given
+ using the suffix "Hz", both following the System International
+ d'Unites Std.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.typedefs" title="basic_stopwatch_accumulator_formatter useful typedefs"><code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_formatter</span></code>
+ useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides basic_stopwatch_accumulator_formatter shortcuts
+ for char and wchar_t.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span>
+ <span class="identifier">stopwatch_accumulator_formatter</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span>
+ <span class="identifier">wstopwatch_accumulator_formatter</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.time_formatter_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp" title="Header <boost/chrono/stopwatches/time_formatter.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.basic_time_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_time_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">basic_time_formatter
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.spec"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+ <span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">basic_time_formatter</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">basic_time_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">time_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_time_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wtime_formatter</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><></span>
+ <span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">time_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="special">};</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.basic_time_formatter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.basic_time_formatter" title="Template Class basic_time_formatter<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_time_formatter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">basic_time_formatter</span></code>
+ is a model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.formatter_req" title="Formatter Requirements"><code class="computeroutput"><span class="identifier">Formatter</span></code></a>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_time_formatter</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">></span> <span class="identifier">ostream_type</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">default_os</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span> <span class="identifier">default_format</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span> <span class="special">></span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">show_time</span><span class="special">(</span> <span class="identifier">Stopwatch</span> <span class="special">&</span> <span class="identifier">stopwatch_</span>
+ <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span>
+ <span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The default places is given by default_places and is 3.
+ </p>
+<p>
+ The default format is "nreal %rs, cpu %cs (%p%), user %us, system
+ %ss\n", where
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">r</span></code>
+ : real process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">u</span></code>
+ : user process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : system process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
+ : user+system process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">p</span></code>
+ : percentage (user+system)/real process clock
+ </li>
+</ul></div>
+<p>
+ All the units are given using the suffix "s" following the
+ System International d'Unites Std.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.typedefs" title="basic_time_formatter useful typedefs"><code class="computeroutput"><span class="identifier">basic_time_formatter</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides basic_time_formatter shortcuts for char and wchar_t.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">basic_time_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">time_formatter</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">basic_time_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wtime_formatter</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.spec"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.time_formatter_hpp.spec" title="stopwatch_reporter_default_formatter Specialization"><code class="computeroutput"><span class="identifier">stopwatch_reporter_default_formatter</span></code>
+ Specialization</a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><></span>
+<span class="keyword">struct</span> <span class="identifier">stopwatch_reporter_default_formatter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">time_formatter</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp" title="Header <boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch_accumulator_time_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.basic_stopwatch_accumulator_time_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.typedefs"><code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span></code>
+ useful typedefs</a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+ <span class="special">></span> <span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">stopwatch_accumulator_time_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wstopwatch_accumulator_time_formatter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.basic_stopwatch_accumulator_time_formatter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.basic_stopwatch_accumulator_time_formatter" title="Template Class basic_stopwatch_accumulator_time_formatter<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span></code>
+ is a model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.formatter_req" title="Formatter Requirements"><code class="computeroutput"><span class="identifier">Formatter</span></code></a>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_stopwatch_accumulator_time_formatter</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">,</span><span class="identifier">Alloc</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span><span class="identifier">Traits</span><span class="special">></span> <span class="identifier">ostream_type</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">default_os</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span> <span class="identifier">default_format</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span> <span class="special">></span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">show_time</span><span class="special">(</span> <span class="identifier">Stopwatch</span> <span class="special">&</span> <span class="identifier">stopwatch_</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The default places is given by default_places and is 3.
+ </p>
+<p>
+ The default format is "%c times, sum<code class="literal">%s, min</code>%m,
+ max<code class="literal">%M, mean</code>%a, frequency<code class="literal">%fHz, lifetime</code>%ls,
+ percentage=%p%\n|real %rs, cpu %cs (%p%), user %us, system %ss",
+ where
+ </p>
+<p>
+ The part before the '|' corresponds to the accumulator format and the
+ part after corresponds to the times format, which will be used for the
+ sum, max, min and mean statistics.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
+ : the counter of the number of times the pair srat/stop has been
+ called.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : the sum of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">m</span></code>
+ : the min of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">M</span></code>
+ : the max of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">a</span></code>
+ : the mean of the samples of elapsed time between the call to start/stop.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">f</span></code>
+ : the frequency of calls to start.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">l</span></code>
+ : the lifetime of the stopwatch_accumulator.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">p</span></code>
+ : the percentage of time spent by this stopwatch respect to its lifetime.
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">r</span></code>
+ : real process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">u</span></code>
+ : user process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : system process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
+ : user+system process clock
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">p</span></code>
+ : percentage (user+system)/real process clock
+ </li>
+</ul></div>
+<p>
+ The time is given using the suffix "s", the frequency is given
+ using the suffix "Hz", both following the System International
+ d'Unites Std.
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.typedefs" title="basic_stopwatch_accumulator_time_formatter useful typedefs"><code class="computeroutput"><span class="identifier">basic_stopwatch_accumulator_time_formatter</span></code>
+ useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides basic_stopwatch_accumulator_time_formatter shortcuts
+ for char and wchar_t.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span>
+ <span class="identifier">stopwatch_accumulator_time_formatter</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">basic_stopwatch_accumulator_time_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span>
+ <span class="identifier">wstopwatch_accumulator_time_formatter</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.t24_hours_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_hpp" title="Header <boost/chrono/stopwatches/t24_hours.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_hpp.t24_hours">Class
+ <code class="computeroutput"><span class="identifier">t24_hours</span></code></a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+ <span class="keyword">class</span> <span class="identifier">t24_hours</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.t24_hours_hpp.t24_hours"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_hpp.t24_hours" title="Class t24_hours">Class
+ <code class="computeroutput"><span class="identifier">t24_hours</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">t24_hours</span></code> helper class
+ decompose a duration in days, hours, minutes, seconds and nanoseconds.
+ It can be used through its static functions or creating an instance and
+ using its fields.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">t24_hours</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <code class="computeroutput"><span class="identifier">ratio</span></code><span class="special"><</span><span class="number">24</span><span class="special">*</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">days</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">hours</span> <span class="identifier">hours</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">minutes</span> <span class="identifier">minutes</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">seconds</span> <span class="identifier">seconds</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span> <span class="identifier">nanoseconds</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">static</span> <span class="identifier">days</span> <span class="identifier">get_days</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">static</span> <span class="identifier">hours</span> <span class="identifier">get_hours</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">static</span> <span class="identifier">minutes</span> <span class="identifier">get_minutes</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">static</span> <span class="identifier">seconds</span> <span class="identifier">get_seconds</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">static</span> <span class="identifier">nanoseconds</span> <span class="identifier">get_nanoseconds</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="identifier">days</span> <span class="identifier">days_</span><span class="special">;</span>
+ <span class="identifier">hours</span> <span class="identifier">hours_</span><span class="special">;</span>
+ <span class="identifier">minutes</span> <span class="identifier">minutes_</span><span class="special">;</span>
+ <span class="identifier">seconds</span> <span class="identifier">seconds_</span><span class="special">;</span>
+ <span class="identifier">nanoseconds</span> <span class="identifier">nanoseconds_</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">explicit</span> <span class="identifier">t24_hours</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp" title="Header <boost/chrono/stopwatches/t24_hours_formatter.hpp>">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">t24_hours_formatter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.basic_24_hours_formatter">Template
+ Class <code class="computeroutput"><span class="identifier">basic_24_hours_formatter</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">basic_24_hours_formatter
useful typedefs</span></dt>
+</dl></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special"><</span>
+ <span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>,</span>
+ <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
+ <span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">basic_24_hours_formatter</span><span class="special">;</span>
+
+ <span class="keyword">typedef</span> <span class="identifier">basic_24_hours_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">t24_hours_formatter</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">basic_24_hours_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wt24_hours_formatter</span><span class="special">;</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.basic_24_hours_formatter"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.basic_24_hours_formatter" title="Template Class basic_24_hours_formatter<>">Template
+ Class <code class="computeroutput"><span class="identifier">basic_24_hours_formatter</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">basic_24_hours_formatter</span></code>
+ is a model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.formatter_req" title="Formatter Requirements"><code class="computeroutput"><span class="identifier">Formatter</span></code></a>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Alloc</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">basic_24_hours_formatter</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">default_os</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">default_format</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span> <span class="special">></span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">show_time</span><span class="special">(</span> <span class="identifier">Stopwatch</span> <span class="special">&</span> <span class="identifier">stopwatch_</span>
+ <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">format</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&</span> <span class="identifier">os</span>
+ <span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The default places is given by default_places and is 3.
+ </p>
+<p>
+ The default format is "%d days(s) %h:%m:%s.%n\n", where
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">d</span></code>
+ : days
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">h</span></code>
+ : hours
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">m</span></code>
+ : minutes
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : seconds
+ </li>
+<li class="listitem">
+ <code class="computeroutput"><span class="special">%</span><span class="identifier">n</span></code>
+ : nanoseconds
+ </li>
+</ul></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.typedefs"></a><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.typedefs" title="basic_24_hours_formatter useful typedefs"><code class="computeroutput"><span class="identifier">basic_24_hours_formatter</span></code> useful typedefs</a>
+</h5></div></div></div>
+<p>
+ The library provides basic_24_hours_formatter shortcuts for char and
+ wchar_t.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">basic_24_hours_formatter</span><span class="special"><</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">t24_hours_formatter</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">basic_24_hours_formatter</span><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span> <span class="identifier">wt24_hours_formatter</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 -2011 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="users_guide.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="appendices.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/users_guide.html
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boost_chrono_stopwatches/users_guide.html 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,921 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Users'Guide</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
+<link rel="home" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="up" href="../index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="prev" href="overview.html" title="Overview">
+<link rel="next" href="reference.html" title="Reference">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="overview.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_chrono_stopwatches.users_guide"></a><a class="link" href="users_guide.html" title="Users'Guide">Users'Guide</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started">Getting
+ Started</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install">Installing
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span></a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.hello">Hello
+ World! </a></span></dt>
+</dl></dd>
+<dt><span class="section">Tutorial</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks">Stopwatches
+ and Stopclocks</a></span></dt>
+<dt><span class="section">Formatters</span></dt>
+</dl></dd>
+<dt><span class="section">Examples</span></dt>
+<dd><dl><dt><span class="section">Reporting</span></dt></dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.users_guide.getting_started"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started" title="Getting Started">Getting
+ Started</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install">Installing
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span></a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.hello">Hello
+ World! </a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install" title="Installing Boost.Chrono.Stopwatches">Installing
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span></a>
+</h4></div></div></div>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono_stopwatches__emphasis__"></a><h6>
+<a name="idp13532448"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono_stopwatches__emphasis__">Getting
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span> </a>
+ </h6>
+<p>
+ You can get the last stable release of <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span>
+ by downloading <code class="literal">stopwatches.zip</code> from the <a href="http://www.boost-consulting.com/vault/index.php?directory=System" target="_top">Boost
+ Vault</a>.
+ </p>
+<p>
+ You can also access the latest (unstable?) state from the <a href="http://svn.boost.org/svn/boost/sandbox/stopwatches" target="_top">Boost
+ Sandbox</a>, directories boost/chrono/stopwatches and libs/chrono/stopwatches.
+ Just go to here
+ and follow the instructions there for anonymous SVN access.
+ </p>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono_stopwatches__emphasis___"></a><h6>
+<a name="idp13539712"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono_stopwatches__emphasis___">Where
+ to install <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span>?
+ </a>
+ </h6>
+<p>
+ The simple way is to decompress (or checkout from SVN) the file in your
+ BOOST_ROOT directory.
+ </p>
+<p>
+ Othesewise, if you decompress in a different directory, you will need to
+ comment some lines, and uncomment and change others in the build/Jamfile
+ and test/Jamfile. Sorry for this, but I have not reached yet to write a
+ Jamfile that is able to work in both environements and use the BOOST_ROOT
+ variable. Any help is welcome.
+ </p>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono_stopwatches__emphasis__"></a><h6>
+<a name="idp13543872"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono_stopwatches__emphasis__">Building
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span> </a>
+ </h6>
+<p>
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span> is a header only
+ library.
+ </p>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.requirements"></a><h6>
+<a name="idp13547568"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.requirements">Requirements</a>
+ </h6>
+<p>
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span> depends on some
+ Boost libraries. For these specific parts you must use either Boost version
+ 1.44.0 or the version in SVN trunk (even if older versions should works
+ also).
+ </p>
+<p>
+ In particular, <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span>
+ depends on:
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Boost.Chrono</span></dt>
+<dd><p>
+ for duration, time_point and clocks, ...
+ </p></dd>
+<dt><span class="term">Boost.Config</span></dt>
+<dd><p>
+ for configuration purposes, ...
+ </p></dd>
+<dt><span class="term">Boost.Exception</span></dt>
+<dd><p>
+ for throw_exception, ...
+ </p></dd>
+<dt><span class="term">Boost.MPL</span></dt>
+<dd><p>
+ for MPL Assert and bool, ...
+ </p></dd>
+<dt><span class="term">Boost.System</span></dt>
+<dd><p>
+ for error_code, ...
+ </p></dd>
+<dt><span class="term">Boost.Input/Output</span></dt>
+<dd><p>
+ for io_state, ...
+ </p></dd>
+<dt><span class="term">Boost.StaticAssert</span></dt>
+<dd><p>
+ for STATIC_ASSERT, ...
+ </p></dd>
+<dt><span class="term">Boost.TypeTraits</span></dt>
+<dd><p>
+ for is_same, ...
+ </p></dd>
+<dt><span class="term">Boost.Utility</span></dt>
+<dd><p>
+ for base_from_memeber, ...
+ </p></dd>
+</dl>
+</div>
+<p>
+ <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span> depends optionally
+ on:
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Boost.Thread</span></dt>
+<dd><p>
+ for thread_specific_ptr when suspendible_clock.hpp is included
+ </p></dd>
+<dt><span class="term">Boost.Accumulator</span></dt>
+<dd><p>
+ for accumulator_set, and statistics features when stopwatch_accumulator.hpp
+ is included
+ </p></dd>
+</dl>
+</div>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_chrono_stopwatches__emphasis__"></a><h6>
+<a name="idp13579776"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_chrono_stopwatches__emphasis__">Building
+ an executable that uses <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span>
+ </a>
+ </h6>
+<p>
+ In addition to linking with the Boost.Chrono library you need also to link
+ with the Boost.System library. If you use Suspendible clocks you will need
+ also with Boost.Thread.
+ </p>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.exceptions_safety_"></a><h6>
+<a name="idp13583120"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.exceptions_safety_">Exceptions
+ safety </a>
+ </h6>
+<p>
+ All functions in the library are exception-neutral and provide strong guarantee
+ of exception safety as long as the underlying parameters provide it.
+ </p>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.thread_safety_"></a><h6>
+<a name="idp13585712"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.thread_safety_">Thread
+ safety </a>
+ </h6>
+<p>
+ All functions in the library are thread-unsafe except when noted explicitly.
+ </p>
+<a name="boost_chrono_stopwatches.users_guide.getting_started.install.tested_compilers_"></a><h6>
+<a name="idp13588224"></a>
+ <a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.install.tested_compilers_">Tested
+ compilers </a>
+ </h6>
+<p>
+ The implementation will eventually work with most C++03 conforming compilers.
+ Current version has been tested on:
+ </p>
+<p>
+ Windows with
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ MSVC 10.0
+ </li></ul></div>
+<p>
+ Cygwin 1.5 with
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ GCC 3.4.4
+ </li></ul></div>
+<p>
+ Cygwin 1.7 with
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ GCC 4.3.4
+ </li></ul></div>
+<p>
+ MinGW with
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ GCC 4.4.0
+ </li>
+<li class="listitem">
+ GCC 4.5.0
+ </li>
+<li class="listitem">
+ GCC 4.5.0 -std=c++0x
+ </li>
+<li class="listitem">
+ GCC 4.6.0
+ </li>
+<li class="listitem">
+ GCC 4.6.0 -std=c++0x
+ </li>
+</ul></div>
+<p>
+ Ubuntu 10.10
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ GCC 4.4.5
+ </li>
+<li class="listitem">
+ GCC 4.4.5 -std=c++0x
+ </li>
+<li class="listitem">
+ GCC 4.5.1
+ </li>
+<li class="listitem">
+ GCC 4.5.1 -std=c++0x
+ </li>
+<li class="listitem">
+ clang 2.8
+ </li>
+</ul></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Please let us know how this works on other platforms/compilers.
+ </p></td></tr>
+</table></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Please send any questions, comments and bug reports to boost <at>
+ lists <dot> boost <dot> org.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.users_guide.getting_started.hello"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.getting_started.hello" title="Hello World!">Hello
+ World! </a>
+</h4></div></div></div>
+<p>
+ If all you want to do is to time a program's execution:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+
+<span class="special">...</span>
+
+<span class="comment">// add this in the scope you want to time,
+</span><span class="comment">// at the point you want the timer to start.
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">rt</span><span class="special">;</span>
+</pre>
+<p>
+ Here is a complete program (stopclock_example.cpp):
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cmath</span><span class="special">></span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10000000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Debug build output was:
+ </p>
+<pre class="programlisting"><span class="identifier">real</span> <span class="number">0.832</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">cpu</span> <span class="number">0.813</span><span class="identifier">s</span> <span class="special">(</span><span class="number">97.7</span><span class="special">%),</span> <span class="identifier">user</span> <span class="number">0.813</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">system</span> <span class="number">0.000</span><span class="identifier">s</span>
+</pre>
+<p>
+ In other words, the program took 0.832 real-time (i.e. wall clock) seconds
+ to execute, while the operating system (Windows in this case) charged 0.813
+ seconds of CPU time to the user and 0 seconds to the system. The total
+ CPU time reported was 0.813 seconds, and that represented utilization of
+ 97.7% of the real-time seconds.
+ </p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial" title="Tutorial">Tutorial</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks">Stopwatches
+ and Stopclocks</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.accumulators">Stopwatches
+ accumulation and statistics</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.function">How
+ can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
+ function signature?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.file_line">How
+ can I prefix each report with <code class="computeroutput"><span class="identifier">__FILE__</span><span class="special">[</span><span class="identifier">__LINE__</span><span class="special">]</span></code> pattern?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.non_static_acc">Can
+ I use an stopclock accumulator which is not static?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.suspend">How
+ can I suspend a stopwatch?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.stats">How
+ to get specific statistics from stopwatches accumulator?</a></span></dt>
+</dl></dd>
+<dt><span class="section">Formatters</span></dt>
+<dd><dl><dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.formatters.other">How
+ can I make a specific formatter when the default do not satisfy my expectations</a></span></dt></dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks" title="Stopwatches and Stopclocks">Stopwatches
+ and Stopclocks</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.accumulators">Stopwatches
+ accumulation and statistics</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.function">How
+ can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
+ function signature?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.file_line">How
+ can I prefix each report with <code class="computeroutput"><span class="identifier">__FILE__</span><span class="special">[</span><span class="identifier">__LINE__</span><span class="special">]</span></code> pattern?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.non_static_acc">Can
+ I use an stopclock accumulator which is not static?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.suspend">How
+ can I suspend a stopwatch?</a></span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.stats">How
+ to get specific statistics from stopwatches accumulator?</a></span></dt>
+</dl></div>
+<p>
+ Knowing how long a program, a function or a specific block takes to execute
+ is useful in both test and production environments. <span class="bold"><strong>Boost.Chrono.Stopwatches</strong></span>
+ introduces the <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> concept which captures
+ the mechanism to measure the elapsed time. A <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> allows to <code class="computeroutput"><span class="identifier">start</span></code>, <code class="computeroutput"><span class="identifier">stop</span></code>,
+ <code class="computeroutput"><span class="identifier">suspend</span></code> and <code class="computeroutput"><span class="identifier">resume</span></code> measuring the elapsed time. <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ is the basic model of <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_req" title="Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> allowing to make a single
+ measure.
+ </p>
+<p>
+ At the user level, the main use case of measuring the elapsed time is to
+ report these measures on the display. <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><code class="computeroutput"><span class="special"><></span></code> provides a run time reporting package
+ that can be invoked in a single line of code to report the usage of a
+ <code class="computeroutput"><span class="identifier">Clock</span></code>. For example
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">100000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">200000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">300000</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Will produce the following output
+ </p>
+<pre class="programlisting"><span class="number">0.006</span><span class="identifier">s</span>
+<span class="number">0.011</span><span class="identifier">s</span>
+<span class="number">0.017</span><span class="identifier">s</span>
+</pre>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.accumulators"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.accumulators" title="Stopwatches accumulation and statistics">Stopwatches
+ accumulation and statistics</a>
+</h5></div></div></div>
+<p>
+ The preceding stopwatch manage only with a measure. It is also interesting
+ to have an statistical view of these times, for example the sum, min,
+ max and mean. <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><code class="computeroutput"><span class="special"><></span></code> associates an accumulator with
+ a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>, so we are able to
+ retrieve any statistical feature Boost.Accumulator provides.
+ </p>
+<p>
+ For example
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">static</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><></span> <span class="special">></span> <span class="identifier">sw</span><span class="special">;</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><></span> <span class="special">>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">sw</span><span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">100000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">200000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">300000</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Will produce the following output
+ </p>
+<pre class="programlisting"><span class="number">3</span> <span class="identifier">times</span><span class="special">,</span> <span class="identifier">sum</span><span class="special">=</span><span class="number">0.034</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">min</span><span class="special">=</span><span class="number">0.006</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">max</span><span class="special">=</span><span class="number">0.017</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">mean</span><span class="special">=</span><span class="number">0.011</span><span class="identifier">s</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.function"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.function" title="How can I prefix each report with BOOST_CURRENT_FUNCTION function signature?">How
+ can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
+ function signature?</a>
+</h5></div></div></div>
+<p>
+ You will need to give a specific format to your <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a>. You just need to
+ concatenate your specific pattern to the default_format of the formatter.
+ </p>
+<p>
+ For example, for a <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a> the default
+ formatter is <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a>,
+ you will need to do something like:
+ </p>
+<pre class="programlisting"><span class="keyword">static</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span> <span class="identifier">acc</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">BOOST_CURRENT_FUNCTION</span><span class="special">)</span> <span class="special">+</span> <span class="string">": "</span>
+ <span class="special">+</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span>
+<span class="special">);</span>
+<a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+</pre>
+<p>
+ Some of you will say that this is too long to type just to get the a
+ report. You can of course define your own macro as
+ </p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">REPORT_FUNCTION_ACCUMULATED_LIFETIME</span><span class="special">\</span>
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span> <span class="special">\</span>
+ <span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span><span class="identifier">_</span>
+ <span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">BOOST_CURRENT_FUNCTION</span><span class="special">)</span> <span class="special">+</span> <span class="string">": "</span> <span class="special">+</span> <span class="special">\</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span> <span class="special">\</span>
+ <span class="special">);</span> <span class="special">\</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="special">\</span>
+ <span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_run_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">(</span><span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">))</span>
+</pre>
+<p>
+ With this macro you will just have to write
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">REPORT_FUNCTION_ACCUMULATED_LIFETIME</span><span class="special">()</span> <span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">100</span><span class="special">));</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.file_line"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.file_line" title="How can I prefix each report with __FILE__[__LINE__] pattern?">How
+ can I prefix each report with <code class="computeroutput"><span class="identifier">__FILE__</span><span class="special">[</span><span class="identifier">__LINE__</span><span class="special">]</span></code> pattern?</a>
+</h5></div></div></div>
+<p>
+ When you want to prefix with the <code class="computeroutput"><span class="identifier">__FILE__</span><span class="special">[</span><span class="identifier">__LINE__</span><span class="special">]</span></code> pattern you can follow the same technique
+ as described below:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">REPORT_LINE_ACCUMULATED_LIFETIME</span> <span class="special">\</span>
+ <span class="keyword">static</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span>
+ <span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">\</span>
+ <span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"["</span> <span class="special">+</span> <span class="identifier">BOOST_STRINGIZE</span><span class="special">(</span><span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"] "</span>
+ <span class="special">+</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span> <span class="special">\</span>
+ <span class="special">);</span> <span class="special">\</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="special">\</span>
+ <span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_run_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span>
+ <span class="special">(</span><span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">))</span>
+</pre>
+<p>
+ Now you can mix fcntion and line reports as follows
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">foo</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">REPORT_FUNCTION_ACCUMULATED_LIFETIME</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">100</span><span class="special">));</span>
+ <span class="special">{</span>
+ <span class="identifier">REPORT_LINE_ACCUMULATED_LIFETIME</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">200</span><span class="special">));</span>
+ <span class="special">}</span>
+
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.non_static_acc"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.non_static_acc" title="Can I use an stopclock accumulator which is not static?">Can
+ I use an stopclock accumulator which is not static?</a>
+</h5></div></div></div>
+<p>
+ The typical example of stopclock_accumulator is to get statistical measures
+ of the time a function takes for each one of its calls. You can also
+ use <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a> to get
+ statistical measures of the time a given loop takes for each one of its
+ laps.
+ </p>
+<pre class="programlisting"><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span> <span class="identifier">acc</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"["</span> <span class="special">+</span> <span class="identifier">BOOST_STRINGIZE</span><span class="special">(</span><span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"] "</span>
+ <span class="special">+</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter" title="Template Class basic_stopwatch_accumulator_formatter<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span>
+<span class="special">);</span>
+<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special"><</span><span class="identifier">N</span><span class="special">;</span> <span class="identifier">i</span><span class="special">++)</span> <span class="special">{</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+ <span class="comment">// ...
+</span><span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.suspend"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.suspend" title="How can I suspend a stopwatch?">How
+ can I suspend a stopwatch?</a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatch</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cmath</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">thread</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+<span class="keyword">double</span> <span class="identifier">res</span><span class="special">;</span>
+<span class="keyword">void</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span>
+<span class="special">{</span>
+ <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><></span> <span class="special">>::</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT</span><span class="special">);</span>
+ <span class="keyword">for</span> <span class="special">(</span><span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="identifier">i</span><span class="special">+=</span><span class="number">1</span><span class="special">)</span>
+ <span class="identifier">res</span><span class="special">+=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="identifier">res</span><span class="special">+</span><span class="number">123.456L</span><span class="special">+</span><span class="identifier">i</span> <span class="special">);</span> <span class="comment">// burn some time
+</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch" title="Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><></span> <span class="special">>::</span><span class="identifier">scoped_suspend</span> <span class="identifier">s</span><span class="special">(</span><span class="identifier">_</span><span class="special">);</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">200</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.stats"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.stopwatches_and_stopclocks.stats" title="How to get specific statistics from stopwatches accumulator?">How
+ to get specific statistics from stopwatches accumulator?</a>
+</h5></div></div></div>
+<p>
+ There are two use cases that coul need to change the statistics associated
+ to a stopwatches accumulator:
+ </p>
+<div class="orderedlist"><ol class="orderedlist" type="1">
+<li class="listitem">
+ We want to reduce the default reporting and we preffer to adapt the
+ statistics to the reporting
+ </li>
+<li class="listitem">
+ We want to report other statistics of the samples
+ </li>
+</ol></div>
+<p>
+ For the first case we just need to change the accumulator_set and the
+ format we want to get. Imagin we want to get only the count, sam and
+ mean statistics, no need to calculate the min neither the max.
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">accumulators</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><</span><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code><span class="special">,</span>
+ <span class="identifier">accumulator_set</span><span class="special"><</span><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+ <span class="identifier">features</span><span class="special"><</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">mean</span>
+ <span class="special">></span>
+ <span class="special">></span>
+ <span class="special">></span> <span class="identifier">my_stopwatch_accumulator_reporter</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">my_stopwatch_accumulator_reporter</span> <span class="identifier">acc</span><span class="special">(</span><span class="string">"%c times, sum=%ss, mean=%as\n"</span><span class="special">);</span>
+ <span class="identifier">my_stopwatch_accumulator_reporter</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ But what would hapend if we haven't forced the format:
+ </p>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">my_stopwatch_accumulator_reporter</span> <span class="identifier">acc</span><span class="special">;</span>
+<span class="identifier">my_stopwatch_accumulator_reporter</span><span class="special">::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+</pre>
+<p>
+ Unfortunately there is no error at compile time. Fortunately, the run-time
+ execution is not undefined and will return 0 for the missing statistics.
+ </p>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.formatters"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.formatters" title="Formatters">Formatters</a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.formatters.other">How
+ can I make a specific formatter when the default do not satisfy my expectations</a></span></dt></dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.tutorial.formatters.other"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.tutorial.formatters.other" title="How can I make a specific formatter when the default do not satisfy my expectations">How
+ can I make a specific formatter when the default do not satisfy my expectations</a>
+</h5></div></div></div>
+<p>
+ Imagine then that we want to report the <code class="computeroutput"><span class="identifier">tag</span><span class="special">::</span><span class="identifier">variance</span><span class="special">(</span><span class="identifier">lazy</span><span class="special">)</span></code>. We will need to include the specific
+ accumulator file
+ </p>
+<pre class="programlisting"><span class="special">...</span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">accumulators</span><span class="special">/</span><span class="identifier">statistics</span><span class="special">/</span><span class="identifier">variance</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="special">...</span>
+<span class="keyword">typedef</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><</span><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code><span class="special">,</span>
+ <span class="identifier">accumulator_set</span><span class="special"><</span><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+ <span class="identifier">features</span><span class="special"><</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">mean</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">variance</span><span class="special">(</span><span class="identifier">lazy</span><span class="special">)</span>
+ <span class="special">></span>
+ <span class="special">></span>
+<span class="special">></span> <span class="identifier">my_stopwatch_accumulator_reporter</span><span class="special">;</span>
+</pre>
+<p>
+ But what happens if we add new statistics to the accumulator_set that
+ are not taken in account by the default formatter? These statistics will
+ simply be ignored. So we will need to define our own accumulator formatter.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><</span><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code><span class="special">,</span>
+ <span class="identifier">accumulator_set</span><span class="special"><</span><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+ <span class="identifier">features</span><span class="special"><</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">mean</span><span class="special">,</span>
+ <span class="identifier">tag</span><span class="special">::</span><span class="identifier">variance</span><span class="special">(</span><span class="identifier">lazy</span><span class="special">)</span>
+ <span class="special">></span>
+ <span class="special">>,</span>
+ <span class="identifier">my_stopwatch_accumulator_formatter</span>
+<span class="special">></span> <span class="identifier">my_stopwatch_accumulator_reporter</span><span class="special">;</span>
+</pre>
+<p>
+ Next follow the definition of a formatter taking care of count, sum,
+ mean and variance
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">my_stopwatch_accumulator_formatter</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">string_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">char</span> <span class="identifier">char_type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="identifier">ostream_type</span><span class="special">;</span>
+
+ <span class="keyword">static</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">default_os</span><span class="special">()</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">;}</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">char_type</span><span class="special">*</span> <span class="identifier">default_format</span><span class="special">()</span> <span class="special">{</span>
+ <span class="keyword">return</span> <span class="string">"%c times, sum=%ss, mean=%as, variance=%vs\n"</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">()</span> <span class="special">{</span> <span class="keyword">return</span> <span class="number">3</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Stopwatch</span> <span class="special">></span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">show_time</span><span class="special">(</span> <span class="identifier">Stopwatch</span> <span class="special">&</span> <span class="identifier">stopwatch_</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span><span class="special">*</span> <span class="identifier">format</span><span class="special">,</span>
+ <span class="keyword">int</span> <span class="identifier">places</span><span class="special">,</span> <span class="identifier">ostream_type</span> <span class="special">&</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Stopwatch</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">duration_t</span><span class="special">;</span>
+ <span class="keyword">typename</span> <span class="identifier">Stopwatch</span><span class="special">::</span><span class="identifier">accumulator</span> <span class="identifier">accumulator</span><span class="special">&</span> <span class="identifier">acc</span> <span class="special">=</span> <span class="identifier">stopwatch_</span><span class="special">.</span><span class="identifier">accumulated</span><span class="special">();</span>
+
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">io</span><span class="special">::</span><span class="identifier">ios_flags_saver</span> <span class="identifier">ifs</span><span class="special">(</span> <span class="identifier">os</span> <span class="special">);</span>
+ <span class="identifier">os</span><span class="special">.</span><span class="identifier">setf</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">fixed</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">floatfield</span> <span class="special">);</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">io</span><span class="special">::</span><span class="identifier">ios_precision_saver</span> <span class="identifier">ips</span><span class="special">(</span> <span class="identifier">os</span> <span class="special">);</span>
+ <span class="identifier">os</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span> <span class="identifier">places</span> <span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="special">;</span> <span class="special">*</span><span class="identifier">format</span><span class="special">;</span> <span class="special">++</span><span class="identifier">format</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="special">*</span><span class="identifier">format</span> <span class="special">!=</span> <span class="char">'%'</span> <span class="special">||</span> <span class="special">!*(</span><span class="identifier">format</span><span class="special">+</span><span class="number">1</span><span class="special">)</span> <span class="special">||</span> <span class="special">!</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">strchr</span><span class="special">(</span><span class="string">"acsv"</span><span class="special">,</span> <span class="special">*(</span><span class="identifier">format</span><span class="special">+</span><span class="number">1</span><span class="special">))</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">os</span> <span class="special"><<</span> <span class="special">*</span><span class="identifier">format</span><span class="special">;</span>
+ <span class="special">}</span> <span class="keyword">else</span> <span class="special">{</span>
+ <span class="special">++</span><span class="identifier">format</span><span class="special">;</span>
+ <span class="keyword">switch</span> <span class="special">(</span> <span class="special">*</span><span class="identifier">format</span> <span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">case</span> <span class="char">'s'</span><span class="special">:</span>
+ <span class="identifier">os</span> <span class="special"><<</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span>
+ <span class="identifier">duration_t</span><span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">sum</span><span class="special">(</span><span class="identifier">acc</span><span class="special">))).</span><span class="identifier">count</span><span class="special">();</span>
+ <span class="keyword">break</span><span class="special">;</span>
+ <span class="keyword">case</span> <span class="char">'a'</span><span class="special">:</span>
+ <span class="identifier">os</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)></span><span class="number">0</span><span class="special">)</span>
+ <span class="special">?</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <code class="computeroutput"><span class="identifier">duration</span></code><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="identifier">duration_t</span><span class="special">(</span>
+ <span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span><span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">mean</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)))).</span><span class="identifier">count</span><span class="special">()</span>
+ <span class="special">:</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">break</span><span class="special">;</span>
+ <span class="keyword">case</span> <span class="char">'c'</span><span class="special">:</span>
+ <span class="identifier">os</span> <span class="special"><<</span> <span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+ <span class="keyword">break</span><span class="special">;</span>
+ <span class="keyword">case</span> <span class="char">'v'</span><span class="special">:</span>
+ <span class="identifier">os</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)></span><span class="number">0</span><span class="special">)</span>
+ <span class="special">?</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <code class="computeroutput"><span class="identifier">duration</span></code><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="identifier">duration_t</span><span class="special">(</span>
+ <span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span><span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">variance</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)))).</span><span class="identifier">count</span><span class="special">()</span>
+ <span class="special">:</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">break</span><span class="special">;</span>
+ <span class="keyword">default</span><span class="special">:</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="number">0</span> <span class="special">&&</span> <span class="string">"my_stopwatch_accumulator_formatter internal logic error"</span><span class="special">);</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+</div>
+</div>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono_stopwatches.users_guide.examples"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.examples" title="Examples">Examples</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Reporting</span></dt>
+<dd><dl>
+<dt><span class="section">stopclock_example.cpp</span></dt>
+<dt><span class="section">stopclock_example2.cpp</span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.examples.reporting.time_command">time
+ command</a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono_stopwatches.users_guide.examples.reporting"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.examples.reporting" title="Reporting">Reporting</a>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">stopclock_example.cpp</span></dt>
+<dt><span class="section">stopclock_example2.cpp</span></dt>
+<dt><span class="section"><a href="users_guide.html#boost_chrono_stopwatches.users_guide.examples.reporting.time_command">time
+ command</a></span></dt>
+</dl></div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.examples.reporting.stopclock_example_cpp"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.examples.reporting.stopclock_example_cpp" title="stopclock_example.cpp">stopclock_example.cpp</a>
+</h5></div></div></div>
+<p>
+ Here is the stopclock_example.cpp program supplied with the Boost Chrono
+ library:
+ </p>
+<p>
+ When the <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span>
+ <span class="identifier">t</span></code> object is created, it starts
+ timing. When it is destroyed at the end of the program, its destructor
+ stops the time counting and displays timing information on cout.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cmath</span><span class="special">></span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10000000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ The output of this program run looks like this:
+ </p>
+<pre class="programlisting"><span class="identifier">wall</span> <span class="number">0.42</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">user</span> <span class="number">0.41</span> <span class="identifier">s</span> <span class="special">+</span> <span class="identifier">system</span> <span class="number">0.00</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">total</span> <span class="identifier">cpu</span> <span class="number">0.41</span> <span class="identifier">s</span><span class="special">,</span> <span class="special">(</span><span class="number">96.3</span><span class="special">%)</span>
+</pre>
+<p>
+ In other words, this program ran in 0.42 seconds as would be measured
+ by a clock on the wall, the operating system charged it for 0.41 seconds
+ of user CPU time and 0 seconds of system CPU time, the total of these
+ two was 0.41, and that represented 96.3 percent of the wall clock time.
+ </p>
+<p>
+ <span class="emphasis"><em>See the source file example/stopclock_example.cpp</em></span>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.examples.reporting.stopclock_example2_cpp"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.examples.reporting.stopclock_example2_cpp" title="stopclock_example2.cpp">stopclock_example2.cpp</a>
+</h5></div></div></div>
+<p>
+ The stopclock_example2.cpp program is the same, except that it supplies
+ additional constructor arguments from the command line:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cmath</span><span class="special">></span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">argv</span><span class="special">[]</span> <span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">format</span> <span class="special">=</span> <span class="identifier">argc</span> <span class="special">></span> <span class="number">1</span> <span class="special">?</span> <span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">:</span> <span class="string">"%t cpu seconds\n"</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">places</span> <span class="special">=</span> <span class="identifier">argc</span> <span class="special">></span> <span class="number">2</span> <span class="special">?</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">atoi</span><span class="special">(</span> <span class="identifier">argv</span><span class="special">[</span><span class="number">2</span><span class="special">]</span> <span class="special">)</span> <span class="special">:</span> <span class="number">2</span><span class="special">;</span>
+
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">(</span> <span class="identifier">format</span><span class="special">,</span> <span class="identifier">places</span> <span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10000000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Here is the output for this program for several sets of command line
+ arguments:
+ </p>
+<pre class="programlisting"><span class="identifier">stopclock_example2</span>
+<span class="number">0.42</span> <span class="identifier">cpu</span> <span class="identifier">seconds</span>
+
+<span class="identifier">stopclock_example2</span> <span class="string">"%w wall clock seconds\n"</span>
+<span class="number">0.41</span> <span class="identifier">wall</span> <span class="identifier">clock</span> <span class="identifier">seconds</span>
+
+<span class="identifier">stopclock_example2</span> <span class="string">"%w wall clock seconds\n"</span> <span class="number">6</span>
+<span class="number">0.421875</span> <span class="identifier">wall</span> <span class="identifier">clock</span> <span class="identifier">seconds</span>
+
+<span class="identifier">stopclock_example2</span> <span class="string">"%t total CPU seconds\n"</span> <span class="number">3</span>
+<span class="number">0.422</span> <span class="identifier">total</span> <span class="identifier">CPU</span> <span class="identifier">seconds</span>
+</pre>
+<p>
+ <span class="emphasis"><em>See the source file example/stopclock_example2.cpp</em></span>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono_stopwatches.users_guide.examples.reporting.time_command"></a><a class="link" href="users_guide.html#boost_chrono_stopwatches.users_guide.examples.reporting.time_command" title="time command">time
+ command</a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cstdlib</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">string</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">argc</span><span class="special">,</span> <span class="keyword">char</span> <span class="special">*</span> <span class="identifier">argv</span><span class="special">[]</span> <span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">argc</span> <span class="special">==</span> <span class="number">1</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"invoke: timex [-v] command [args...]\n"</span>
+ <span class="string">" command will be executed and timings displayed\n"</span>
+ <span class="string">" -v option causes command and args to be displayed\n"</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span><span class="special">;</span>
+
+ <span class="keyword">bool</span> <span class="identifier">verbose</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">argc</span> <span class="special">></span> <span class="number">1</span> <span class="special">&&</span> <span class="special">*</span><span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">==</span> <span class="char">'-'</span> <span class="special">&&</span> <span class="special">*(</span><span class="identifier">argv</span><span class="special">[</span><span class="number">1</span><span class="special">]+</span><span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="char">'v'</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">verbose</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">argv</span><span class="special">;</span>
+ <span class="special">--</span><span class="identifier">argc</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">argc</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">i</span> <span class="special">></span> <span class="number">1</span> <span class="special">)</span> <span class="identifier">s</span> <span class="special">+=</span> <span class="char">' '</span><span class="special">;</span>
+ <span class="identifier">s</span> <span class="special">+=</span> <span class="identifier">argv</span><span class="special">[</span><span class="identifier">i</span><span class="special">];</span>
+ <span class="special">}</span>
+
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">verbose</span> <span class="special">)</span>
+ <span class="special">{</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"command: \""</span> <span class="special"><<</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\"\n"</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock" title="Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+
+ <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">system</span><span class="special">(</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">()</span> <span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ <span class="emphasis"><em>See the source file example/timex.cpp</em></span>
+ </p>
+</div>
+</div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 -2011 Vicente J. Botet Escriba<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="overview.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/boostbook.css 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,611 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompany-
+ ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 9pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 9pt;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 9pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ /* Program listings in tables don't get borders */
+ td .programlisting,
+ td .screen
+ {
+ margin: 0pc 0pc 0pc 0pc;
+ padding: 0pc 0pc 0pc 0pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font-size: 140%; }
+ h2 { font-weight: bold; font-size: 140%; }
+ h3 { font-weight: bold; font-size: 130%; }
+ h4 { font-weight: bold; font-size: 120%; }
+ h5 { font-weight: normal; font-style: italic; font-size: 110%; }
+ h6 { font-weight: normal; font-style: italic; font-size: 100%; }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 130% }
+ h5 tt.computeroutput { font-size: 130% }
+ h6 tt.computeroutput { font-size: 130% }
+
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Copyright footer
+=============================================================================*/
+ .copyright-footer
+ {
+ text-align: right;
+ font-size: 70%;
+ }
+
+ .copyright-footer p
+ {
+ text-align: right;
+ font-size: 80%;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 80%;
+ line-height: 1.15;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+ /* Code on toc */
+ .toc .computeroutput { font-size: 120% }
+
+ /* No margin on nested menus */
+
+ .toc dl dl { margin: 0; }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ font-size: 9pt;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 80%;
+ }
+
+ table.simplelist
+ {
+ width: auto !important;
+ margin: 0em !important;
+ padding: 0em !important;
+ border: none !important;
+ }
+ table.simplelist td
+ {
+ margin: 0em !important;
+ padding: 0em !important;
+ text-align: left !important;
+ font-size: 9pt !important;
+ border: none !important;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 9pt; /* A little bit smaller than the main text */
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ div.variablelist
+ {
+ margin: 1em 0;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt,
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+ div.variablelist dl dt
+ {
+ margin-bottom: 0.2em;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 0em 0em 0.5em 2em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p,
+ div.variablelist dl dd p
+ {
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ body {
+ background-color: #FFFFFF;
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #FFFFFF; }
+ .dk_grey_bkd { background-color: #999999; }
+
+ /* Links */
+ a, a .keyword, a .identifier, a .special, a .preprocessor
+ a .char, a .comment, a .string, a .number
+ {
+ color: #005a9c;
+ }
+
+ a:visited, a:visited .keyword, a:visited .identifier,
+ a:visited .special, a:visited .preprocessor a:visited .char,
+ a:visited .comment, a:visited .string, a:visited .number
+ {
+ color: #9c5a9c;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #F0F0F0;
+ border: 1px solid #DCDCDC;
+ }
+
+ .copyright-footer
+ {
+ color: #8F8F8F;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid gray;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid gray;
+ border-collapse: collapse;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid gray;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid gray;
+ }
+
+ table.simplelist tr td
+ {
+ border: none !important;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
+
+/*=============================================================================
+ Images
+=============================================================================*/
+
+ span.inlinemediaobject img
+ {
+ vertical-align: middle;
+ }
+
+/*==============================================================================
+ Super and Subscript: style so that line spacing isn't effected, see
+ http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
+==============================================================================*/
+
+sup,
+sub {
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ position: relative;
+
+}
+
+/* For internet explorer: */
+
+* html sup,
+* html sub {
+ vertical-align: bottom;
+}
+
+sup {
+ bottom: 1ex;
+}
+
+sub {
+ top: .5ex;
+}
+
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/alert.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/home.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/important.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/next.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/next_disabled.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/note.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/prev_disabled.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/smiley.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/up.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/up_disabled.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/index.html 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,101 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Boost.Chrono.Stopwatches 0.3.0</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
+<link rel="home" href="index.html" title="Boost.Chrono.Stopwatches 0.3.0">
+<link rel="next" href="boost_chrono_stopwatches/overview.html" title="Overview">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="boost_chrono_stopwatches/overview.html"><img src="images/next.png" alt="Next"></a></div>
+<div class="article">
+<div class="titlepage">
+<div>
+<div><h2 class="title">
+<a name="boost_chrono_stopwatches"></a>Boost.Chrono.Stopwatches 0.3.0</h2></div>
+<div><div class="authorgroup"><div class="author"><h3 class="author">
+<span class="firstname">Vicente J.</span> <span class="surname">Botet Escriba</span>
+</h3></div></div></div>
+<div><p class="copyright">Copyright © 2009 -2011 Vicente J. Botet Escriba</p></div>
+<div><div class="legalnotice">
+<a name="idp13411072"></a><p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></div>
+</div>
+<hr>
+</div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section">Overview</span></dt>
+<dd><dl>
+<dt><span class="section">Motivation</span></dt>
+<dt><span class="section">Description</span></dt>
+</dl></dd>
+<dt><span class="section">Users'Guide</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="boost_chrono_stopwatches/users_guide.html#boost_chrono_stopwatches.users_guide.getting_started">Getting
+ Started</a></span></dt>
+<dt><span class="section">Tutorial</span></dt>
+<dt><span class="section">Examples</span></dt>
+</dl></dd>
+<dt><span class="section">Reference </span></dt>
+<dd><dl>
+<dt><span class="section"><a href="boost_chrono_stopwatches/reference.html#boost_chrono_stopwatches.reference.stopwatches_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/reference.html#boost_chrono_stopwatches.reference.stopwatches_stopwatches_hpp">Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">/</span><span class="identifier">stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/reference.html#boost_chrono_stopwatches.reference.other_clocks">Other
+ clocks</a></span></dt>
+<dt><span class="section">Stopwatches</span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/reference.html#boost_chrono_stopwatches.reference.reporters">Stopwatch
+ Reporters</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/reference.html#boost_chrono_stopwatches.reference.formatters">Stopwatch
+ Formatters</a></span></dt>
+</dl></dd>
+<dt><span class="section">Appendices</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.history">Appendix
+ A: History</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.rationale">Appendix
+ B: Rationale</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.implementation">Appendix
+ C: Implementation Notes</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.faq">Appendix D:
+ FAQ</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.acknowledgements">Appendix
+ E: Acknowledgements</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.tests">Appendix F:
+ Tests</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.tickets">Appendix
+ G: Tickets</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.perf">Appendix H:
+ Performances</a></span></dt>
+<dt><span class="section"><a href="boost_chrono_stopwatches/appendices.html#boost_chrono_stopwatches.appendices.todo">Appendix I:
+ Future plans</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Stopwatches is not part of the Boost libraries.
+ </p></td></tr>
+</table></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: September 11, 2011 at 12:32:44 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="boost_chrono_stopwatches/overview.html"><img src="images/next.png" alt="Next"></a></div>
+</body>
+</html>
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/html/standalone_HTML.manifest
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/html/standalone_HTML.manifest 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,5 @@
+index.html
+boost_chrono_stopwatches/overview.html
+boost_chrono_stopwatches/users_guide.html
+boost_chrono_stopwatches/reference.html
+boost_chrono_stopwatches/appendices.html
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/index.html
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/index.html 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,9 @@
+<html>
+<head>
+<meta http-equiv="refresh" content="0; URL=html/index.html">
+</head>
+<body>
+Automatic redirection failed, please go to
+../../doc/html/stopwatches.html
+</body>
+</html>
Added: sandbox/stopwatches/libs/chrono/stopwatches/doc/stopwatches.qbk
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/doc/stopwatches.qbk 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,3228 @@
+[/
+ / Copyright (c) 2009-20010 Vicente J. Botet Escriba
+ /
+ / Distributed under the Boost Software License, Version 1.0. (See accompanying
+ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ /]
+
+[article Boost.Chrono.Stopwatches
+ [quickbook 1.5]
+ [version 0.3.0]
+ [authors [Botet Escriba, Vicente J.]]
+ [copyright 2009-2011 Vicente J. Botet Escriba]
+ [license
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ [@http://www.boost.org/LICENSE_1_0.txt])
+ ]
+]
+
+[/==================]
+[def __Boost_Chrono__ [*Boost.Chrono]]
+
+[def __Boost_Stopwatches__ [*Boost.Chrono.Stopwatches]]
+
+
+[/===============================================]
+
+[def __common_type__ `common_type`]
+
+[/===============================================]
+[def __ratio__ `ratio`]
+
+
+
+[def __ratio_add `ratio_add`]
+[def __ratio_subtract `ratio_subtract`]
+[def __ratio_multiply `ratio_multiply`]
+[def __ratio_divide `ratio_divide`]
+
+
+[def __ratio_equal `ratio_equal]]
+[def __ratio_not_equal `ratio_not_equal`]
+[def __ratio_less `ratio_less`]]
+[def __ratio_less_equal `ratio_less_equal`]
+[def __ratio_greater `ratio_greater`]
+[def __ratio_greater_equal `ratio_greater_equal`]
+
+
+[template ratio_si_typedefs[link_text] [link_text]]
+[def __atto [ratio_si_typedefs `atto`]]
+[def __femto [ratio_si_typedefs `femto`]]
+[def __pico [ratio_si_typedefs `pico`]]
+[def __nano [ratio_si_typedefs `nano`]]
+[def __micro [ratio_si_typedefs `micro`]]
+[def __milli [ratio_si_typedefs `milli`]]
+[def __centi [ratio_si_typedefs `centi`]]
+[def __deci [ratio_si_typedefs `deci`]]
+[def __deca [ratio_si_typedefs `deca`]]
+[def __hecto [ratio_si_typedefs `hecto`]]
+[def __kilo [ratio_si_typedefs `kilo`]]
+[def __mega [ratio_si_typedefs `mega`]]
+[def __giga [ratio_si_typedefs `giga`]]
+[def __tera [ratio_si_typedefs `tera`]]
+[def __peta [ratio_si_typedefs `peta`]]
+[def __exa [ratio_si_typedefs `exa`]]
+
+
+[/==================]
+
+
+[template chrono_conf[link_text] [link_text]]
+
+
+[def __BOOST_CHRONO_USES_STATIC_ASSERT [chrono_conf `BOOST_CHRONO_USES_STATIC_ASSERT`]]
+[def __BOOST_CHRONO_USES_MPL_ASSERT [chrono_conf `BOOST_CHRONO_USES_MPL_ASSERT`]]
+[def __BOOST_CHRONO_USES_ARRAY_ASSERT [chrono_conf `BOOST_CHRONO_USES_ARRAY_ASSERT`]]
+
+[/def __BOOST_CHRONO_HAS_CLOCK_STEADY [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_STEADY `BOOST_CHRONO_HAS_CLOCK_STEADY`]]
+
+[def __BOOST_CHRONO_HAS_CLOCK_STEADY `BOOST_CHRONO_HAS_CLOCK_STEADY`]
+
+
+[/template clock_concept_link[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.clock [link_text]]]
+[template clock_concept_link[link_text] [link_text]]
+[def __clock_concept__ [clock_concept_link `Clock` concept]]
+[def __clock_concept_type__ [clock_concept_link `Clock`]]
+[def __clock_req__ [clock_concept_link `Clock` requirements]]
+[def __Clock__ [clock_concept_link `Clock`]]
+[def __Clock_s__ [clock_concept_link `Clock`'s]]
+
+
+[/template duration_link[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.duration [link_text]]]
+[template duration_link[link_text] [link_text]]
+[def __duration__ [duration_link `duration`]]
+[def __duration_s__ [duration_link `duration`'s]]
+
+[/==================]
+[/template time_point_link[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.time_point [link_text]]]
+[template time_point_link[link_text] [link_text]]
+[def __time_point__ [time_point_link `time_point`]]
+[def __time_point_s__ [time_point_link `time_point`'s]]
+
+[/==================]
+[/template system_clock_link[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.system_clock [link_text]]]
+[template system_clock_link[link_text] [link_text]]
+[def __system_clock__ [system_clock_link `system_clock`]]
+
+[/==================]
+[/template steady_clock_link[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.steady_clock [link_text]]]
+[template steady_clock_link[link_text] [link_text]]
+[def __steady_clock__ [steady_clock_link `steady_clock`]]
+
+[/==================]
+[/template high_resolution_clock_link[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock [link_text]]]
+[template high_resolution_clock_link[link_text] [link_text]]
+[def __high_resolution_clock__ [high_resolution_clock_link `high_resolution_clock`]]
+
+[/def __duration_cast__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.duration_cast `duration_cast`]]
+[def __duration_cast__ `duration_cast`]
+
+[/def __time_point_cast__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.time_point_cast `time_point_cast`]]
+[def __time_point_cast__ `time_point_cast`]
+
+
+[/template duration_typedefs[link_text] [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.duration_typedefs [link_text]]]
+[template duration_typedefs[link_text] [link_text]]
+[def __nanoseconds__ [duration_typedefs `nanoseconds`]]
+[def __microseconds__ [duration_typedefs `microseconds`]]
+[def __milliseconds__ [duration_typedefs `milliseconds`]]
+[def __seconds__ [duration_typedefs `seconds`]]
+[def __minutes__ [duration_typedefs `minutes`]]
+[def __hours__ [duration_typedefs `hours`]]
+[def __days__ [duration_typedefs `days`]]
+
+[/def __common_type_spe__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.common_type_spe `common_type`]]
+[def __common_type_spe__ `common_type`]
+
+[/==================]
+[/def __treat_as_floating_point__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.traits.treat_as_floating_point `treat_as_floating_point`]]
+[def __treat_as_floating_point__ `treat_as_floating_point`]
+[/def __duration_values__ `duration_values`]
+[def __duration_values__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.traits.duration_values `duration_values`]]
+[/def __zero__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.traits.duration_values.zero `zero`]]
+[def __zero__ `zero`]
+[/def __max__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.traits.duration_values.max `max`]]
+[def __max__ `max`]
+[/def __min__ [link boost_chrono_stopwatches.reference.cpp0x.chrono_chrono_hpp.traits.duration_values.min `min`]]
+[def __min__ `min`]
+
+
+[/==================]
+[template SuspendibleClock_concept_link[link_text] [link boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_req [link_text]]]
+[def __SuspendibleClock_concept__ [SuspendibleClock_concept_link `SuspendibleClock` concept]]
+[def __SuspendibleClock_concept_type__ [SuspendibleClock_concept_link `SuspendibleClock`]]
+[def __SuspendibleClock_req__ [SuspendibleClock_concept_link `SuspendibleClock` requirements]]
+[def __SuspendibleClock__ [SuspendibleClock_concept_link `SuspendibleClock`]]
+
+[/==================]
+[template stopwatch_concept_link[link_text] [link boost_chrono_stopwatches.reference.stopwatches.stopwatch_req [link_text]]]
+[def __stopwatch_concept__ [stopwatch_concept_link `Stopwatch` concept]]
+[def __stopwatch_concept_type__ [stopwatch_concept_link `Stopwatch`]]
+[def __stopwatch_req__ [stopwatch_concept_link `Stopwatch` requirements]]
+[def __Stopwatch__ [stopwatch_concept_link `Stopwatch`]]
+
+
+[def __stopwatch__ [link boost_chrono_stopwatches.reference.stopwatches.stopwatch_hpp.stopwatch `stopwatch`]]
+[def __lightweight_stopwatch__ [link boost_chrono_stopwatches.reference.stopwatches.lightweight_stopwatch_hpp.lightweight_stopwatch `lightweight_stopwatch`]]
+
+[def __stopwatch_accumulator__ [link boost_chrono_stopwatches.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator `stopwatch_accumulator`]]
+
+
+[def __stopwatch_reporter__ [link boost_chrono_stopwatches.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter `stopwatch_reporter`]]
+
+[def __stopclock_accumulator__ [link boost_chrono_stopwatches.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator `stopclock_accumulator`]]
+
+[/==================]
+[template formatter_concept_link[link_text] [link boost_chrono_stopwatches.reference.reporters.formatter_req [link_text]]]
+[def __formatter_concept__ [formatter_concept_link `Formatter` concept]]
+[def __formatter_concept_type__ [formatter_concept_link `Formatter`]]
+[def __formatter_req__ [formatter_concept_link `Formatter` requirements]]
+[def __Formatter__ [formatter_concept_link `Formatter`]]
+
+[def __stopclock__ [link boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock `stopclock`]]
+[def __stopclock_clock__ [link boost_chrono_stopwatches.reference.reporters.stopclock_hpp.stopclock `stopclock<Clock>`]]
+
+[def __scoped_stopclock__ [link boost_chrono_stopwatches.reference.reporters.scoped_stopclock_hpp.scoped_stopclock `scoped_stopclock`]]
+
+[def __process_real_cpu_clock__ `process_real_cpu_clock`]
+
+[def __process_system_cpu_clock__ `process_system_cpu_clock`]
+
+[def __process_user_cpu_clock__ `process_user_cpu_clock`]
+
+[def __thread_clock__ `thread_clock`]
+
+[def __suspendible_clock__ [link boost_chrono_stopwatches.reference.other_clocks.suspendible_clock_hpp.suspendible_clock `suspendible_clock`]]
+
+[def __stopwatch_accumulator_formatter__ [link boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter `stopwatch_accumulator_formatter`]]
+
+[def __stopwatch_accumulator_time_formatter__ [link boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_time_formatter_hpp.basic_stopwatch_accumulator_time_formatter `stopwatch_accumulator_time_formatter`]]
+
+[def __basic_stopwatch_formatter__ [link boost_chrono_stopwatches.reference.formatters.stopwatch_formatter_hpp.basic_stopwatch_formatter `stopwatch_accumulator_formatter`]]
+
+[def __basic_stopwatch_accumulator_formatter__ [link boost_chrono_stopwatches.reference.formatters.stopwatch_accumulator_formatter_hpp.basic_stopwatch_accumulator_formatter `stopwatch_accumulator_formatter`]]
+
+[def __basic_24_hours_formatter__ [link boost_chrono_stopwatches.reference.formatters.t24_hours_formatter_hpp.basic_24_hours_formatter `basic_24_hours_formatter`]]
+
+
+
+[warning Stopwatches is not part of the Boost libraries.]
+
+[/===============]
+[section Overview]
+[/===============]
+
+
+
+[/====================================]
+[heading How to Use This Documentation]
+[/====================================]
+
+This documentation makes use of the following naming and formatting conventions.
+
+* Code is in `fixed width font` and is syntax-highlighted.
+* Replaceable text that you will need to supply is in [~italics].
+* Free functions are rendered in the code font followed by (), as in `free_function()`.
+* If a name refers to a class template, it is specified like this: `class_template<>`; that is, it is in code font and its name is followed by `<>` to indicate that it is a class template.
+* If a name refers to a function-like macro, it is specified like this: `MACRO()`;
+ that is, it is uppercase in code font and its name is followed by `()` to indicate that it is a function-like macro. Object-like macros appear without the trailing `()`.
+* Names that refer to /concepts/ in the generic programming sense are specified in CamelCase.
+
+[note In addition, notes such as this one specify non-essential information that provides additional background or rationale.]
+
+Finally, you can mentally add the following to any code fragments in this document:
+
+ // Include all of Stopwatches files
+ #include <boost/chrono/stopwatches.hpp>
+ using namespace boost::chrono;
+
+
+[/=================]
+[section Motivation]
+[/=================]
+
+
+
+[heading Measuring elapsed time]
+
+Knowing how long a program, a function or a specific code block takes to execute is useful in both test and production environments.
+__Boost_Stopwatches__ introduces the __Stopwatch__ concept which is a mechanism to measure the elapsed time.
+A Stopwatch allows to start, stop, suspend and resume measuring the elapsed time.
+__stopwatch__`<>` is the basic model of __Stopwatch__.
+
+[heading Reporting elapsed time]
+
+It is often necessary to report elapsed time on a user display or in a log file. __stopwatch_reporter__<> provides a runtime reporting mechanism for this purpose which can be invoked in just one line of code.
+
+ using namespace boost::chrono;
+ int main()
+ {
+ __stopwatch_reporter__<__stopwatch__<process_cpu_clock> > _;
+ // ...
+ }
+
+Will produce the following output
+
+ real 0.034s, cpu 0.031s (93.0%), user 0.031s, system 0.000s
+
+As this is one of the expression more commonly use, the library provides a stopclock shortcut so the preceding can be writen as
+
+ int main()
+ {
+ __stopclock__<> _;
+ // ...
+ }
+
+
+[heading How reliable are these measures?]
+
+There are a number of things that can lead to unreliable measurement (see [link boost_chrono_stopwatches.appendices.rationale here] for more details), but they mostly amount to reporting overhead. Boost.Chrono provides two ways to improve reliability of time measurements. A __stopwatch_accumulator__ only reports statistics once all measurements have been acquired, which removes reporting overhead from the measurements. The other approach is to use a __SuspendibleClock__ such that the reporting overhead can be ignored by suspending elapsed time tracking during reporting operations
+
+[endsect]
+
+[/==================]
+[section Description]
+[/==================]
+
+
+On top of the standard facilities of __Boost_Chrono__, __Boost_Stopwatches__ provides:
+
+* Stopwatches: A facility to measure elapsed time with the ability to start, stop, suspend, or resume measurement.
+ * __Stopwatch__ concept
+ * Scoped helper classes allowing to pairwise start/stop operations, suspend/resume and resume/suspend a __Stopwatch__.
+ * __stopwatch__, model of __Stopwatch__ capturing elapsed __Clock__ times.
+ * __stopwatch_accumulator__, model of __Stopwatch__ capturing cummulated elapsed Clock times.
+
+* Stopclocks: a complete time reporting package that can be invoked in a single line of code.
+ * __stopwatch_reporter__, convenient reporting to an output stream (including wide char streams) of the elapsed time of models of __Stopwatch__ results.
+ * __stopclock_clock__ shortcut of `__stopwatch_reporter__<__stopwatch__<Clock>>`
+
+[/
+
+* Suspendible clock
+ * __SuspendibleClock__ concept
+ * scope_suspend which do suspend/resume if the __Clock__ is a model of __SuspendibleClock__ concept, and nothing otherwise.
+ * template class __suspendible_clock__
+]
+
+[endsect]
+
+[endsect]
+
+
+[/==============================]
+[section:users_guide Users'Guide]
+[/==============================]
+
+[/======================================]
+[section:getting_started Getting Started]
+[/======================================]
+
+[/======================================]
+[section:install Installing __Boost_Stopwatches__]
+[/======================================]
+
+[/=================================]
+[heading Getting __Boost_Stopwatches__ ]
+[/=================================]
+
+You can get the last stable release of __Boost_Stopwatches__ by downloading [^stopwatches.zip] from the
+[@http://www.boost-consulting.com/vault/index.php?directory=System Boost Vault].
+
+You can also access the latest (unstable?) state from the [@http://svn.boost.org/svn/boost/sandbox/stopwatches Boost Sandbox], directories boost/chrono/stopwatches and libs/chrono/stopwatches. Just go to [@http://svn.boost.org/trac/boost/wiki/BoostSubversion here] and follow the instructions there for anonymous SVN access.
+
+[/==========================================]
+[heading Where to install __Boost_Stopwatches__? ]
+[/==========================================]
+
+The simple way is to decompress (or checkout from SVN) the file in your BOOST_ROOT directory.
+
+Othesewise, if you decompress in a different directory, you will need to comment some lines, and uncomment and change others in the build/Jamfile and test/Jamfile. Sorry for this, but I have not reached yet to write a Jamfile that is able to work in both environements and use the BOOST_ROOT variable. Any help is welcome.
+
+[/=================================]
+[heading Building __Boost_Stopwatches__ ]
+[/=================================]
+
+__Boost_Stopwatches__ is a header only library.
+
+[/===================]
+[heading Requirements]
+[/===================]
+
+__Boost_Stopwatches__ depends on some Boost libraries. For these specific parts you must use either Boost version 1.44.0 or the version in SVN trunk (even if older versions should works also).
+
+In particular, __Boost_Stopwatches__ depends on:
+
+[variablelist
+[
+ [[@http://www.boost.org/libs/chrono [*Boost.Chrono]]] [for duration, time_point and clocks, ...]
+]
+[
+ [[@http://www.boost.org/libs/config [*Boost.Config]]] [for configuration purposes, ...]
+]
+[
+ [[@http://www.boost.org/libs/exception [*Boost.Exception]]] [for throw_exception, ...]
+]
+[
+ [[@http://www.boost.org/libs/mpl [*Boost.MPL]]] [for MPL Assert and bool, ...]
+]
+[
+ [[@http://www.boost.org/libs/system [*Boost.System]]] [for error_code, ...]
+]
+[
+ [[@http://www.boost.org/libs/io [*Boost.Input/Output]]] [for io_state, ...]
+]
+[
+ [[@http://www.boost.org/libs/static_assert [*Boost.StaticAssert]]] [for STATIC_ASSERT, ...]
+]
+[
+ [[@http://www.boost.org/libs/type_traits [*Boost.TypeTraits]]] [for is_same, ...]
+]
+[
+ [[@http://www.boost.org/libs/utility [*Boost.Utility]]] [for base_from_memeber, ...]
+]
+]
+
+__Boost_Stopwatches__ depends optionally on:
+
+[variablelist
+[
+ [[@http://www.boost.org/libs/thread [*Boost.Thread]]] [for thread_specific_ptr when suspendible_clock.hpp is included]
+]
+[
+ [[@http://www.boost.org/libs/accumulator [*Boost.Accumulator]]] [for accumulator_set, and statistics features when stopwatch_accumulator.hpp is included]
+]
+]
+
+
+[/=========================================================]
+[heading Building an executable that uses __Boost_Stopwatches__ ]
+[/=========================================================]
+
+In addition to linking with the Boost.Chrono library you need also to link with the Boost.System library. If you use Suspendible clocks you will need also with Boost.Thread.
+
+[/=========================]
+[heading Exceptions safety ]
+[/=========================]
+
+All functions in the library are exception-neutral and provide strong guarantee of exception safety as long as the underlying parameters provide it.
+
+[/=====================]
+[heading Thread safety ]
+[/=====================]
+
+All functions in the library are thread-unsafe except when noted explicitly.
+
+[/========================]
+[heading Tested compilers ]
+[/========================]
+
+The implementation will eventually work with most C++03 conforming compilers.
+Current version has been tested on:
+
+Windows with
+
+* MSVC 10.0
+
+Cygwin 1.5 with
+
+* GCC 3.4.4
+
+Cygwin 1.7 with
+
+* GCC 4.3.4
+
+MinGW with
+
+* GCC 4.4.0
+* GCC 4.5.0
+* GCC 4.5.0 -std=c++0x
+* GCC 4.6.0
+* GCC 4.6.0 -std=c++0x
+
+Ubuntu 10.10
+
+* GCC 4.4.5
+* GCC 4.4.5 -std=c++0x
+* GCC 4.5.1
+* GCC 4.5.1 -std=c++0x
+* clang 2.8
+
+[note Please let us know how this works on other platforms/compilers.]
+
+[note Please send any questions, comments and bug reports to boost <at> lists <dot> boost <dot> org.]
+
+[endsect]
+[/====================]
+[section:hello Hello World! ]
+[/====================]
+
+If all you want to do is to time a program's execution:
+
+ #include <boost/chrono/stopwatches/stopclock.hpp>
+
+ ...
+
+ // add this in the scope you want to time,
+ // at the point you want the timer to start.
+ boost::chrono::__stopclock__<> rt;
+
+Here is a complete program (stopclock_example.cpp):
+
+ #include <boost/chrono/stopwatches/stopclock.hpp>
+ #include <cmath>
+
+ int main()
+ {
+ boost::chrono::__stopclock__<> t;
+
+ for ( long i = 0; i < 10000000; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+
+Debug build output was:
+
+ real 0.832s, cpu 0.813s (97.7%), user 0.813s, system 0.000s
+
+In other words, the program took 0.832 real-time (i.e. wall clock) seconds to execute, while the operating system (Windows in this case) charged 0.813 seconds of CPU time to the user and 0 seconds to the system. The total CPU time reported was 0.813 seconds, and that represented utilization of 97.7% of the real-time seconds.
+
+[endsect]
+
+[endsect]
+
+
+[section Tutorial]
+
+
+
+
+[section Stopwatches and Stopclocks]
+
+Knowing how long a program, a function or a specific block takes to execute is useful in both test and production environments.
+__Boost_Stopwatches__ introduces the __Stopwatch__ concept which captures the mechanism to measure the elapsed time.
+A __Stopwatch__ allows to `start`, `stop`, `suspend` and `resume` measuring the elapsed time.
+__stopwatch__`<>` is the basic model of __Stopwatch__ allowing to make a single measure.
+
+At the user level, the main use case of measuring the elapsed time is to report these measures on the display.
+__stopwatch_reporter__`<>` provides a run time reporting package that can be invoked in a single line of code to report the usage of a __Clock__.
+For example
+
+ using namespace boost::chrono;
+
+ int f1(long j) {
+ __stopwatch_reporter__<__stopwatch__<> > _;
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+ int main() {
+ f1(100000);
+ f1(200000);
+ f1(300000);
+ return 0;
+ }
+
+Will produce the following output
+
+ 0.006s
+ 0.011s
+ 0.017s
+
+[/
+[section:reliable How reliable are these measures?]
+
+[note this section need to be reworked, the ideas are there, but ...]
+
+There are three context on which you can get unreliable measures:
+
+* precision of your clock. If the precision of your clock is 10ms you can not be able to measure the time spent by blocks of code that takes the same order of magnitude. The library provides a hig_resolution_clock that gives you the higher resolution available on your platform. Respect to the precision, nothing to do except to take the clock with the highest resolution and measures blocks of code that will spent time having more than one order of magnitude the precision of the clock.
+
+``
+#include <boost/chrono/chrono.hpp>
+ ...
+ __stopclock__<__high_resolution_clock__> _;
+``
+
+* When your application is multithreaded, and you use a process clock, the time you get is the delay during which your block has been executed, in concurrency with the other threads of execution. If what you want is the time spent by this specific thread another clock is needed. The library provide a __thread_clock__ that returns the time spent by the thread on platforms providing this kind of data. It can be used as follows
+
+``
+#include <boost/chrono/thread_clock.hpp>
+...
+#if defined(__BOOST_CHRONO_HAS_THREAD_CLOCK)
+ __stopclock__<__thread_clock__> _;
+#else
+ __stopclock__<__process_real_cpu_clock__> _;
+#endif
+``
+
+* Nested stopclocks (usually nested function calls where each function contains a __stopclock__). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
+
+Some measures let us think that most of the time spent by the __stopclock__ mechanism is associated to the logging part. There are two things we can do to make the difference :
+
+* Avoid expensive operations as logging while doing the measures. Note that reporting in itself is not too expensive as far as we don't need to flush the buffer. This can be achieved either using a __stopclock_accumulator__, 'i.e. don't report until all the measures have been compiled and then report some statistics or using an asynchronous stream.
+
+* Introduce some cheap mechanism that allows us to make the difference between the application time and the intrinsic __stopclock__ time. When the precision of the clock is enough, we can suspend the counting of the Clock while we are spending time reporting the measures, and resume it once the work is done. The library provide a Clock wrapper __suspendible_clock__ that make the resulting clock suspendible. The __stopwatch_reporter__ is able to detect if the __Clock__ is Suspendible and then `suspend`/`resume` the __Clock__ while doing the report.
+
+ __stopclock__<__suspendible_clock__<Clock> > _;
+
+
+See the performances section for more deep details.
+
+[endsect]
+]
+
+[section:accumulators Stopwatches accumulation and statistics]
+
+The preceding stopwatch manage only with a measure. It is also interesting to have an statistical view of these times, for example the sum, min, max and mean. __stopwatch_accumulator__`<>` associates an accumulator with a __stopwatch__, so we are able to retrieve any statistical feature Boost.Accumulator provides.
+
+For example
+
+ using namespace boost::chrono;
+
+ int f1(long j) {
+ static __stopwatch_reporter__<__stopwatch_accumulator__<> > sw;
+ __stopwatch_reporter__<__stopwatch_accumulator__<> >::scoped_run _(sw);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+ int main() {
+ f1(100000);
+ f1(200000);
+ f1(300000);
+ return 0;
+ }
+
+Will produce the following output
+
+ 3 times, sum=0.034s, min=0.006s, max=0.017s, mean=0.011s
+
+
+[endsect]
+
+
+
+[section:function How can I prefix each report with `BOOST_CURRENT_FUNCTION` function signature?]
+
+You will need to give a specific format to your __stopclock__. You just need to concatenate your specific pattern to the default_format of the formatter.
+
+For example, for a __stopclock_accumulator__ the default formatter is __stopwatch_accumulator_formatter__, you will need to do something like:
+
+ static __stopclock_accumulator__<> acc(
+ std::string(BOOST_CURRENT_FUNCTION) + ": "
+ + __stopwatch_accumulator_formatter__::default_format()
+ );
+ __stopclock_accumulator__<>::scoped_run _(acc);
+
+
+Some of you will say that this is too long to type just to get the a report. You can of course define your own macro as
+
+ #define REPORT_FUNCTION_ACCUMULATED_LIFETIME\
+ static boost::chrono::__stopclock_accumulator__<> \
+ BOOST_JOIN(_accumulator_, __LINE__)_
+ ( std::string(BOOST_CURRENT_FUNCTION) + ": " + \
+ boost::chrono::__stopwatch_accumulator_formatter__::default_format() \
+ ); \
+ boost::chrono::__stopclock_accumulator__<>::scoped_run \
+ BOOST_JOIN(_accumulator_run_, __LINE__) \
+ (BOOST_JOIN(_accumulator_, __LINE__))
+
+
+With this macro you will just have to write
+
+ void foo()
+ {
+ REPORT_FUNCTION_ACCUMULATED_LIFETIME() ;
+ boost::this_thread::sleep(boost::posix_time::milliseconds(100));
+ // ...
+ }
+
+[endsect]
+
+[section:file_line How can I prefix each report with `__FILE__[__LINE__]` pattern?]
+
+When you want to prefix with the `__FILE__[__LINE__]` pattern you can follow the same technique as described below:
+
+ #define REPORT_LINE_ACCUMULATED_LIFETIME \
+ static __stopclock_accumulator__<>
+ BOOST_JOIN(_accumulator_, __LINE__) \
+ ( std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] "
+ + __stopwatch_accumulator_formatter__::default_format() \
+ ); \
+ __stopclock_accumulator__<>::scoped_run \
+ BOOST_JOIN(_accumulator_run_, __LINE__)
+ (BOOST_JOIN(_accumulator_, __LINE__))
+
+Now you can mix fcntion and line reports as follows
+
+ void foo()
+ {
+ REPORT_FUNCTION_ACCUMULATED_LIFETIME;
+ boost::this_thread::sleep(boost::posix_time::milliseconds(100));
+ {
+ REPORT_LINE_ACCUMULATED_LIFETIME;
+ boost::this_thread::sleep(boost::posix_time::milliseconds(200));
+ }
+
+ }
+
+[endsect]
+
+[section:non_static_acc Can I use an stopclock accumulator which is not static?]
+
+The typical example of stopclock_accumulator is to get statistical measures of the time a function takes for each one of its calls. You can also use __stopclock_accumulator__ to get statistical measures of the time a given loop takes for each one of its laps.
+
+ __stopclock_accumulator__<> acc(
+ std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] "
+ + __stopwatch_accumulator_formatter__::default_format()
+ );
+ for (int i=0; i<N; i++) {
+ __stopclock_accumulator__<>::scoped_run _(acc);
+ // ...
+ }
+
+
+[endsect]
+
+[section:suspend How can I suspend a stopwatch?]
+
+ #include <boost/chrono/stopwatches/stopwatch.hpp>
+ #include <cmath>
+ #include <boost/thread.hpp>
+
+
+ using namespace boost::chrono;
+ double res;
+ void f1(long j)
+ {
+ __stopwatch_reporter__<__stopwatch__<> >:: _(BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT);
+ for (long i =0; i< j; i+=1)
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ __stopwatch_reporter__<__stopwatch__<> >::scoped_suspend s(_);
+ boost::this_thread::sleep(boost::posix_time::milliseconds(200));
+ }
+
+[endsect]
+
+[section:stats How to get specific statistics from stopwatches accumulator?]
+
+There are two use cases that coul need to change the statistics associated to a stopwatches accumulator:
+
+# We want to reduce the default reporting and we preffer to adapt the statistics to the reporting
+# We want to report other statistics of the samples
+
+For the first case we just need to change the accumulator_set and the format we want to get. Imagin we want to get only the count, sam and mean statistics, no need to calculate the min neither the max.
+
+ using namespace boost::accumulators;
+
+ typedef __stopwatch_reporter__<__stopwatch_accumulator__<__process_real_cpu_clock__,
+ accumulator_set<__process_real_cpu_clock__::rep,
+ features<
+ tag::count,
+ tag::sum,
+ tag::mean
+ >
+ >
+ > my_stopwatch_accumulator_reporter;
+
+ int f1(long j)
+ {
+ static my_stopwatch_accumulator_reporter acc("%c times, sum=%ss, mean=%as\n");
+ my_stopwatch_accumulator_reporter::scoped_run _(acc);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+
+But what would hapend if we haven't forced the format:
+
+ static my_stopwatch_accumulator_reporter acc;
+ my_stopwatch_accumulator_reporter::scoped_run _(acc);
+
+Unfortunately there is no error at compile time. Fortunately, the run-time execution is not undefined and will return 0 for the missing statistics.
+
+
+[endsect]
+
+[endsect]
+
+
+[section Formatters]
+[section:other How can I make a specific formatter when the default do not satisfy my expectations]
+
+Imagine then that we want to report the `tag::variance(lazy)`. We will need to include the specific accumulator file
+
+ ...
+ #include <boost/accumulators/statistics/variance.hpp>
+ ...
+ typedef __stopwatch_reporter__<__stopwatch_accumulator__<__process_real_cpu_clock__,
+ accumulator_set<__process_real_cpu_clock__::rep,
+ features<
+ tag::count,
+ tag::sum,
+ tag::mean,
+ tag::variance(lazy)
+ >
+ >
+ > my_stopwatch_accumulator_reporter;
+
+But what happens if we add new statistics to the accumulator_set that are not taken in account by the default formatter? These statistics will simply be ignored. So we will need to define our own accumulator formatter.
+
+ typedef __stopwatch_reporter__<__stopwatch_accumulator__<__process_real_cpu_clock__,
+ accumulator_set<__process_real_cpu_clock__::rep,
+ features<
+ tag::count,
+ tag::sum,
+ tag::mean,
+ tag::variance(lazy)
+ >
+ >,
+ my_stopwatch_accumulator_formatter
+ > my_stopwatch_accumulator_reporter;
+
+Next follow the definition of a formatter taking care of count, sum, mean and variance
+
+ class my_stopwatch_accumulator_formatter {
+ public:
+ typedef std::string string_type;
+ typedef char char_type;
+ typedef std::ostream ostream_type;
+
+ static ostream_type & default_os() {return std::cout;}
+ static const char_type* default_format() {
+ return "%c times, sum=%ss, mean=%as, variance=%vs\n";
+ }
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char_type* format,
+ int places, ostream_type & os, system::error_code & ec)
+ {
+ typedef typename Stopwatch::duration duration_t;
+ typename Stopwatch::accumulator accumulator& acc = stopwatch_.accumulated();
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ for ( ; *format; ++format ) {
+ if ( *format != '%' || !*(format+1) || !std::strchr("acsv", *(format+1)) ) {
+ os << *format;
+ } else {
+ ++format;
+ switch ( *format ) {
+ case 's':
+ os << boost::chrono::duration<double>(
+ duration_t(accumulators::sum(acc))).count();
+ break;
+ case 'a':
+ os << (accumulators::count(acc)>0)
+ ? boost::chrono::__duration__<double>(duration_t(
+ duration_t::rep(accumulators::mean(acc)))).count()
+ : 0;
+ break;
+ case 'c':
+ os << accumulators::count(acc);
+ break;
+ case 'v':
+ os << (accumulators::count(acc)>0)
+ ? boost::chrono::__duration__<double>(duration_t(
+ duration_t::rep(accumulators::variance(acc)))).count()
+ : 0;
+ break;
+ default:
+ assert(0 && "my_stopwatch_accumulator_formatter internal logic error");
+ }
+ }
+ }
+ }
+ };
+
+
+
+[endsect]
+
+[endsect]
+
+
+[endsect]
+[/===============]
+[section Examples]
+[/===============]
+
+
+
+[section Reporting]
+
+
+
+[/============================]
+[section stopclock_example.cpp]
+
+Here is the stopclock_example.cpp program supplied with the Boost Chrono library:
+
+[/stopclock_example_cpp]
+
+When the `stopclock<> t` object is created, it starts timing. When it is destroyed at the end of the program, its destructor stops the time counting and displays timing information on cout.
+
+ #include <boost/chrono/stopwatches/stopclock.hpp>
+ #include <cmath>
+
+ int main()
+ {
+ boost::chrono::__stopclock__<> t;
+
+ for ( long i = 0; i < 10000000; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+
+The output of this program run looks like this:
+
+ wall 0.42 s, user 0.41 s + system 0.00 s = total cpu 0.41 s, (96.3%)
+
+In other words, this program ran in 0.42 seconds as would be measured by a clock on the wall, the operating system charged it for 0.41 seconds of user CPU time and 0 seconds of system CPU time, the total of these two was 0.41, and that represented 96.3 percent of the wall clock time.
+
+['See the source file [@../../example/stopclock_example.cpp example/stopclock_example.cpp]]
+
+[endsect]
+
+
+[/=============================]
+[section stopclock_example2.cpp]
+
+The stopclock_example2.cpp program is the same, except that it supplies additional constructor arguments from the command line:
+
+ #include <boost/chrono/stopwatches/stopclock.hpp>
+ #include <cmath>
+
+ int main( int argc, char * argv[] )
+ {
+ const char * format = argc > 1 ? argv[1] : "%t cpu seconds\n";
+ int places = argc > 2 ? std::atoi( argv[2] ) : 2;
+
+ boost::chrono::__stopclock__<> t( format, places );
+
+ for ( long i = 0; i < 10000000; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+
+Here is the output for this program for several sets of command line arguments:
+
+ stopclock_example2
+ 0.42 cpu seconds
+
+ stopclock_example2 "%w wall clock seconds\n"
+ 0.41 wall clock seconds
+
+ stopclock_example2 "%w wall clock seconds\n" 6
+ 0.421875 wall clock seconds
+
+ stopclock_example2 "%t total CPU seconds\n" 3
+ 0.422 total CPU seconds
+
+['See the source file [@../../example/stopclock_example2.cpp example/stopclock_example2.cpp]]
+
+[endsect]
+
+[/===============================================================]
+[section time command]
+
+ #include <boost/chrono/stopwatches/stopclock.hpp>
+ #include <cstdlib>
+ #include <string>
+ #include <iostream>
+
+ int main( int argc, char * argv[] )
+ {
+ if ( argc == 1 )
+ {
+ std::cout << "invoke: timex [-v] command [args...]\n"
+ " command will be executed and timings displayed\n"
+ " -v option causes command and args to be displayed\n";
+ return 1;
+ }
+
+ std::string s;
+
+ bool verbose = false;
+ if ( argc > 1 && *argv[1] == '-' && *(argv[1]+1) == 'v' )
+ {
+ verbose = true;
+ ++argv;
+ --argc;
+ }
+
+ for ( int i = 1; i < argc; ++i )
+ {
+ if ( i > 1 ) s += ' ';
+ s += argv[i];
+ }
+
+ if ( verbose )
+ { std::cout << "command: \"" << s.c_str() << "\"\n"; }
+
+ boost::chrono::__stopclock__<> t;
+
+ return std::system( s.c_str() );
+ }
+
+['See the source file [@../../example/timex.cpp example/timex.cpp]]
+
+[endsect]
+[endsect]
+
+
+
+[/
+[/================================]
+[section:ext_references External Resources]
+[/================================]
+
+[variablelist
+
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21 [*C++ Standards Committee's current Working Paper]]]
+ [The most authoritative reference material for the library is the C++ Standards Committee's current Working Paper (WP). 20.9 Time utilities "time", 20.4 Compile-time rational arithmetic "ratio", 20.6.7 Other transformations "meta.trans.other"]
+]
+
+[
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]]]
+ [From Howard E. Hinnant, Walter E. Brown, Jeff Garland and Marc Paterno. Is very informative and provides motivation for key design decisions]
+]
+
+
+[
+ [[@http://home.roadrunner.com/~hinnant/issue_review/lwg-defects.html#934 [*LGW 934. duration is missing operator%]]]
+ [From Terry Golubiewski. Is very informative and provides motivation for key design decisions]
+]
+
+[
+ [[@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281 [*LWG 1281. CopyConstruction and Assignment between ratios having the same normalized form]]]
+ [From Vicente Juan Botet Escriba.]
+]
+
+[
+ [[@http://www.digitalmars.com/d/2.0/phobos/std_traits.html#CommonType D programming language - CommonType trait]]
+ [From Andrei Alexandrescu.]
+]
+
+
+]
+
+[endsect]
+]
+
+[endsect]
+[endsect]
+
+[/=================]
+[section:reference Reference ]
+[/=================]
+
+[/=============================================]
+[section:stopwatches_hpp Header `<boost/chrono/stopwatches.hpp>`]
+[/=============================================]
+
+
+ #include <boost/chrono/stopwatches/stopwatches.hpp>
+
+[endsect]
+
+[/=============================================]
+[section:stopwatches_stopwatches_hpp Header `<boost/chrono/stopwatches/stopwatches.hpp>`]
+[/=============================================]
+
+This file include all the stopwatches related files except the suspendible related files.
+
+ #include <boost/chrono/stopwatches/scoped_stopclock.hpp>
+ #include <boost/chrono/stopwatches/stopclock.hpp>
+ #include <boost/chrono/stopwatches/stopclock_accumulator.hpp>
+ #include <boost/chrono/stopwatches/stopwatch.hpp>
+ #include <boost/chrono/stopwatches/stopwatch_accumulator.hpp>
+ #include <boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp>
+ #include <boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp>
+ #include <boost/chrono/stopwatches/stopwatch_formatter.hpp>
+ #include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
+ #include <boost/chrono/stopwatches/stopwatch_scoped.hpp>
+ #include <boost/chrono/stopwatches/time_formatter.hpp>
+ #include <boost/chrono/stopwatches/t24_hours.hpp>
+ #include <boost/chrono/stopwatches/t24_hours_formatter.hpp>
+
+[endsect]
+
+[section:other_clocks Other clocks]
+
+[section:suspendible_clock_req `SuspendibleClock` Requirements]
+
+A `SuspendibleClock` is a Clock that in addition supports `suspend`/`resume` operations.
+
+A `SuspendibleClock` must meet the requirements in the following Table.
+
+In this table `C` denote `clock` types.
+
+[table SuspendibleClock Requirements
+ [[expression] [return type] [operational semantics]]
+ [[`C::suspend()`] [`void`] [Suspends the time counting of the clock C.]]
+ [[`C::resume()`] [`void`] [Resumes the time counting of the clock C.]]
+ [[`C::suspended()`] [__duration__] [Returns the delay(duration during which the clock has been suspended.]]
+]
+
+[section:suspend Static Member Function `suspend()`]
+
+ void suspend( system::error_code & ec = throws() );
+
+[*Effect:] Suspends the SuspendibleClock.
+
+[*Throw:] Any exception the `Clock::now(ec)` function can throw. Otherwise `ec` is set with the correspoding error code set by `Clock::now(ec)`.
+
+[endsect]
+[section:resume Static Member Function `resume()`]
+
+ void resume( system::error_code & ec = throws() );
+
+[*Effect:] Resumes the `SuspendibleClock`.
+
+[*Throw:] Any exception the `Clock::now(ec)` can throw. Otherwise `ec` is set with the correspoding error code set by `Clock::now(ec)`.
+
+[endsect]
+
+[section:suspended Static Member Function `suspended()`]
+
+ duration suspended( system::error_code & ec = throws() );
+
+[*Returns:] the cumalative elapsed duration during which the `SuspendibleClock` has been suspendeed.
+
+[*Throw:] Any exception the Clock::now function can throw if `ec == throws()`. Otherwise `ec` is set with the correspoding error code set by `Clock::now(ec)`.
+
+[endsect]
+
+Models of `SuspendibleClock`:
+
+* __suspendible_clock__
+
+
+[endsect]
+
+
+[/==================================================================]
+[section:scoped_suspend_hpp Header `<boost/chrono/stopwatches/scoped_suspend.hpp>`]
+[/==================================================================]
+
+ namespace boost { namespace chrono {
+ template <class Clock> struct is_suspendible;
+ template <class Clock> class scoped_suspend;
+ }}
+
+[section:is_suspendible Meta Function Class `is_suspendible`]
+
+ template <class Clock>
+ struct is_suspendible : mpl:: false_ {};
+
+[endsect]
+
+[section:scoped_suspend Template Class `scoped_suspend`]
+
+ template <class Clock>
+ class scoped_suspend {
+ public:
+ scoped_suspend(system::error_code & ec = throws()) {}
+ ~scoped_suspend() {}
+ private:
+ scoped_suspend(); // = delete;
+ scoped_suspend(const scoped_suspend&); // = delete;
+ scoped_suspend& operator=(const scoped_suspend&); // = delete;
+ };
+
+[endsect]
+
+[endsect]
+
+
+[/==================================================================]
+[section:suspendible_clock_hpp Header `<boost/chrono/stopwatches/suspendible_clock.hpp>`]
+[/==================================================================]
+
+ namespace boost { namespace chrono {
+
+ template <class Clock>
+ class suspendible_clock;
+
+ template <class Clock>
+ struct is_suspendible<suspendible_clock<Clock> >;
+
+ template <class Clock>
+ class scoped_suspend<suspendible_clock<Clock> >;
+
+ }}
+
+[section:suspendible_clock Template Class `suspendible_clock<>`]
+
+Given a __Clock__, __suspendible_clock__ <__Clock__> is a model of __SuspendibleClock__.
+
+ template < class Clock >
+ class suspendible_clock {
+ public:
+ typedef typename Clock::duration duration;
+ typedef typename Clock::rep rep;
+ typedef typename Clock::period period;
+ typedef chrono::__time_point__<suspendible_clock<Clock> > time_point;
+ static const bool is_steady = Clock::is_steady;
+
+ static time_point now( system::error_code & ec = throws() );
+ static void suspend( system::error_code & ec = throws() );
+ static void resume( system::error_code & ec = throws() );
+ static duration suspended(system::error_code & ec = throws());
+ };
+
+[section `scoped_suspend` specialization for `suspendible_clock<>`]
+
+ template <class Clock>
+ class scoped_suspend<suspendible_clock<Clock> > {
+ public:
+ scoped_suspend(system::error_code & ec = throws());
+ ~scoped_suspend();
+ };
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+[/==================================================]
+[section:stopwatches Stopwatches]
+[/==================================================]
+
+[section:stopwatch_req `Stopwatch` Requirements]
+
+A Stopwatch measure the amount of time elapsed from a start point in time to the stop point time or the accumulation of them. Stopwatches can in addition be restarted, suspended and resumed.
+
+A Stopwatch must meet the requirements in the following table. In this table `S`, `S1` and `S2` denote Stopwatches types. `s` is an instance of `S`.
+
+[table Stopwatch Requirements
+ [[expression] [return type] [operational semantics]]
+ [[`S::clock`] [A model of __Clock__.] [The clock associated to this Stopwatch.]]
+ [[`S::duration`] [`S::clock::duration`] [The __duration__ type of the `clock`.]]
+ [[`S::time_point`] [`S::clock::time_point`] [The __time_point__ type of the `clock`.]]
+ [[`S::scoped_run`] [`stopwatch_runner<stopwatch<Clock> >`] [RAI which `start`/`stop` the `stopwatch`.]]
+ [[`S::scoped_suspend`] [`stopwatch_suspender<stopwatch<Clock> >`] [RAI which `suspend`/`resume` the `stopwatch`.]]
+ [[`S::scoped_resume`] [`stopwatch_resumer<stopwatch<Clock> >`] [RAI which `resume`/`suspend` the `stopwatch`.]]
+ [[`s.start()`] [`S::time_point`] [starts a Stopwatch.]]
+ [[`s.restart()`] [`std::pair<S::duration,S::time_point>`] [restarts a Stopwatch.]]
+ [[`s.stop()`] [`S::duration`] [stops a Stopwatch.]]
+ [[`s.resume()`] [`S::time_point`] [resume a Stopwatch.]]
+ [[`s.suspend()`] [`S::duration`] [suspends a Stopwatch.]]
+ [[`s.elapsed()`] [`S::duration`] [the elapsed time while the Stopwatch was running.]]
+]
+
+
+[section:start Member Function `start()`]
+
+ time_point start( system::error_code & ec = throws() );
+
+[*Effect:] Starts running the stopwatch.
+
+[*Returns:] the starting time point.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+[section:stop Member Function `stop()`]
+
+ duration stop( system::error_code & ec = throws() );
+
+[*Effect:] Stops running the stopwatch.
+
+[*Returns:] The cummulated elapsed time.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+[section:suspend Member Function `suspend()`]
+
+ duration suspend( system::error_code & ec = throws() );
+
+[*Effect:] Suspends the stopwatch.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+[section:resume Member Function `resume()`]
+
+ time_point resume( system::error_code & ec = throws() );
+
+[*Effect:] Resumes the stopwatch.
+
+[*Returns:] the starting time point.
+
+[*Throw:] Any exception the Clock::now function can throw.
+
+[endsect]
+
+[section:restart Member Function `restart()`]
+
+ time_point restart( system::error_code & ec = throws() );
+
+[*Effect:] `stop`/`start` the stopwatch.
+
+[*Returns:] the starting time point.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+
+[section:elapsed Member Function `elapsed()`]
+
+ duration elapsed(system::error_code & ec = throws()) const;
+
+[*Returns:] the cumulated elapsed time.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+
+
+Models of `Stopwatch`:
+
+* __stopwatch__
+* __stopwatch_accumulator__
+
+[endsect]
+
+
+[/==================================================]
+[section:lightweight_stopwatch_hpp Header `<boost/chrono/stopwatches/lightweight_stopwatch.hpp>`]
+[/==================================================]
+
+
+ namespace boost { namespace chrono {
+ struct dont_start_t;
+ static const dont_start_t dont_start;
+
+ template <class Clock=high_resolution_clock,
+ typename Features=void,
+ typename Weight=void
+ > class __lightweight_stopwatch__;
+
+ typedef <see above> system_lightweight_stopwatch;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see above> steady_lightweight_stopwatch;
+ #endif
+ typedef <see above> high_resolution_lightweight_stopwatch;
+ }}
+
+[section:dont_start_t Class `dont_start_t`]
+
+Structure used to don't start a `lightweight_stopwatch` at construction time.
+
+ struct dont_start_t;
+ static const dont_start_t dont_start;
+
+[endsect]
+
+[section:lightweight_stopwatch Template Class `lightweight_stopwatch<>`]
+
+`lightweight_stopwatch<>` is a model of a __stopwatch_concept__.
+
+Knowing how long a part of a program takes to execute is useful in both test and production environments.
+A __lightweight_stopwatch__ object measures elapsed time. It is recommended to use it with clocks that measure wall clock rather than CPU time since the intended use is performance measurement on systems where total elapsed time is more important than just process or CPU time.
+
+The maximum measurable elapsed time depends on the Clock parameter. The accuracy of timings depends on the
+accuracy of timing information provided the Clock, and this could varies a great deal from one clock to another.
+
+ template <class Clock, typename Features, typename Weight>
+ class lightweight_stopwatch {
+ public:
+ typedef Clock clock;
+ typedef typename Clock::duration duration;
+ typedef typename Clock::time_point time_point;
+ typedef <see below> storage;
+
+ explicit lightweight_stopwatch( storage& st, system::error_code & ec = throws() );
+ lightweight_stopwatch( storage& st, const dont_start_t& t );
+
+ ~lightweight_stopwatch();
+
+ time_point start( system::error_code & ec = throws() );
+ duration stop( system::error_code & ec = throws() );
+ std::pair<duration,time_point> restart( system::error_code & ec = throws() );
+ duration suspend( system::error_code & ec = throws() );
+ time_point resume( system::error_code & ec = throws() );
+ duration elapsed( system::error_code & ec = throws() );
+ time_point now( system::error_code & ec = throws() );
+ void reset( system::error_code & ec = throws() );
+
+ storage& get_storage( );
+ duration lifetime( system::error_code & ec = throws() );
+
+ typedef stopwatch_runner<lightweight_stopwatch<Clock> > scoped_run;
+ typedef stopwatch_suspender<lightweight_stopwatch<Clock> > scoped_suspend;
+ typedef stopwatch_resumer<lightweight_stopwatch<Clock> > scoped_resume;
+
+ };
+
+
+`storage` is either `Clock::duration` if Features and Weight are void and `accumulators::accumulator_set<typename Clock::duration::rep, Features, Weight>` otherwise.
+
+Only the specificities of this class are documented here. See __stopwatch_concept__ for the common parts.
+
+[section:c1 Constructor `lightweight_stopwatch( storage&, system::error_code &)`]
+
+ explicit lightweight_stopwatch( storage& st, system::error_code & ec = throws() );
+
+[*Effect:] constructs and starts the lightweight_stopwatch.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+
+[section:c2 Constructor `lightweight_stopwatch( storage&, dont_start_t &)`]
+
+ explicit lightweight_stopwatch( storage& st, const dont_start_t& t );
+
+[*Effect:] constructs the lightweight_stopwatch without starting it.
+
+[*Throw:] Nothing.
+
+[endsect]
+
+
+
+
+[section:get_storage Member Function `get_storage()`]
+
+ storage& get_storage();
+
+[*Returns:] the assocaited storage reference.
+
+[*Throw:] Nothing.
+
+[endsect]
+
+
+[section:reset Member Function `reset()`]
+
+ void reset( );
+
+[*Effect:] Stop the lightweight_stopwatch and reinit the storage.
+
+[*Throw:] Nothing.
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+
+[/==================================================]
+[section:stopwatch_hpp Header `<boost/chrono/stopwatches/stopwatch.hpp>`]
+[/==================================================]
+
+
+ namespace boost { namespace chrono {
+ template <class Clock=high_resolution_clock> class __stopwatch__;
+
+ template <class Clock>
+ struct stopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef stopwatch_formatter type;
+ };
+
+ template <class Clock>
+ struct wstopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef wstopwatch_formatter type;
+ };
+
+ typedef <see above> system_stopwatch;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see above> steady_stopwatch;
+ #endif
+ typedef <see above> high_resolution_stopwatch;
+ }}
+
+
+[section:stopwatch Template Class `stopwatch<>`]
+
+`stopwatch<>` is a model of a __stopwatch_concept__.
+
+Knowing how long a part of a program takes to execute is useful in both test and production environments.
+A __stopwatch__ object measures elapsed time. It is recommended to use it with clocks that measure wall clock rather than CPU time since the intended use is performance measurement on systems where total elapsed time is more important than just process or CPU time.
+
+The maximum measurable elapsed time depends on the Clock parameter. The accuracy of timings depends on the
+accuracy of timing information provided the Clock, and this could varies a great deal from one clock to another.
+
+ template <class Clock>
+ class stopwatch :
+ private base_from_member<typename Clock::duration>,
+ public lightweight_stopwatch<Clock>
+ {
+ public:
+ explicit stopwatch( system::error_code & ec = throws() );
+ explicit stopwatch( const dont_start_t& t );
+
+ };
+
+[section:c1 Constructor `stopwatch( system::error_code &)`]
+
+ explicit stopwatch( system::error_code & ec = throws() );
+
+[*Effect:] constructs and starts the stopwatch.
+
+[*Throw:] Any exception the `Clock::now` function can throw when `ec` is `throws()`
+
+[endsect]
+
+[section:c2 Constructor `stopwatch( dont_start_t &)`]
+
+ explicit stopwatch( const dont_start_t& t );
+
+[*Effect:] constructs the stopwatch without starting it.
+
+[*Throw:] Nothing.
+
+[endsect]
+
+[endsect]
+
+[section:spec `stopwatch_reporter_default_formatter` Specialization]
+
+The `stopwatch_reporter_default_formatter` of a `stopwatch<Clock>` is a `stopwatch_formatter`.
+
+ template <class Clock>
+ struct stopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef stopwatch_formatter type;
+ };
+
+The `wstopwatch_reporter_default_formatter` of a `stopwatch<Clock>` is a `wstopwatch_formatter`.
+
+ template <class Clock>
+ struct wstopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef wstopwatch_formatter type;
+ };
+
+[endsect]
+
+[section:stopwatch_typedefs `stopwatch` useful typedefs]
+
+The library provides stopwatch short cuts for all the models of __Clock__, replacing clock by stopwatch.
+
+ typedef boost::chrono::stopwatch< boost::chrono::system_clock >
+ system_stopwatch;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::stopwatch< boost::chrono::steady_clock >
+ steady_stopwatch;
+ #endif
+ typedef boost::chrono::stopwatch< boost::chrono::high_resolution_clock >
+ high_resolution_stopwatch;
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:stopwatch_accumulator_hpp Header `<boost/chrono/stopwatches/stopwatch_accumulator.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <class Clock,
+ typename Features=accumulators::features<
+ accumulators::tag::count,
+ accumulators::tag::sum,
+ accumulators::tag::min,
+ accumulators::tag::max,
+ accumulators::tag::mean >,
+ typename Weight=void
+ > class __stopwatch_accumulator__;
+
+ template <class Clock, class Accumulator>
+ struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+ typedef stopwatch_accumulator_formatter type;
+ };
+
+ template <class Clock, class Accumulator>
+ struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+ typedef wstopwatch_accumulator_formatter type;
+ };
+
+ typedef <see below> system_stopwatch_accumulator;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see below> steady_stopwatch_accumulator;
+ #endif
+ typedef <see below> high_resolution_stopwatch_accumulator;
+
+ }}
+
+
+[section:stopwatch_accumulator Template Class `stopwatch_accumulator<>`]
+
+A `stopwatch_accumulator<>` is a model of a __stopwatch_concept__ that allows to accumulate the time in several times instead of at once as it is the case of the class __stopwatch__`<>`.
+
+ template <class Clock, typename Features, typename Weight>
+ class stopwatch_accumulator
+ : private base_from_member<
+ typename accumulators::accumulator_set<
+ typename Clock::duration::rep, Features, Weight
+ >
+ >,
+ public lightweight_stopwatch<Clock,Features,Weight>
+ {
+ public:
+ stopwatch_accumulator( );
+ };
+
+[section:c Constructor `stopwatch_accumulator()`]
+
+ stopwatch_accumulator();
+
+[*Effect:] Initialize the elapsed duration and the times counter to 0. The stopwatch is not started.
+
+[endsect]
+
+[endsect]
+
+[section:spec `stopwatch_reporter_default_formatter` Specialization]
+
+The `stopwatch_reporter_default_formatter` of a `stopwatch_accumulator<Clock>` is a `stopwatch_accumulator_formatter`.
+
+ template <class Clock, class Accumulator>
+ struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+ typedef stopwatch_accumulator_formatter type;
+ };
+
+The `wstopwatch_reporter_default_formatter` of a `stopwatch_accumulator<Clock>` is a `wstopwatch_accumulator_formatter`.
+
+ template <class Clock, class Accumulator>
+ struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+ typedef wstopwatch_accumulator_formatter type;
+ };
+
+[endsect]
+
+
+[section:typedefs `stopwatch_accumulator` useful typedefs]
+
+The library provides stopwatch_accumulator shortcuts for all the models of __Clock__, replacing clock by stopwatch_accumulator.
+
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::system_clock >
+ system_stopwatch_accumulator;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::steady_clock >
+ steady_stopwatch_accumulator;
+ #endif
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::high_resolution_clock >
+ high_resolution_stopwatch_accumulator;
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:stopwatch_scoped_hpp Header `<boost/chrono/stopwatches/stopwatch_scoped.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <class Stopwatch> class stopwatch_runner;
+ template <class Stopwatch> class stopwatch_suspender;
+ template <class Stopwatch> class stopwatch_resumer;
+ }}
+
+Boost.Chrono provides some helper classes ensuring pairwised operations (start/stop, suspend/resume, resule/suspend).
+
+[section:stopwatch_runner Template Class `stopwatch_runner<>`]
+
+This helper class ensures that the start/stop are pairwised. Starts the associated __Stopwatch__ at construction time, and stops it at destruction time.
+
+ template <class Stopwatch> class stopwatch_runner {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_runner(stopwatch & a, system::error_code & ec = throws());
+ ~stopwatch_runner();
+ stopwatch_runner() = delete;
+ stopwatch_runner(const stopwatch_runner&) = delete;
+ stopwatch_runner& operator=(const stopwatch_runner&) = delete;
+ };
+
+Usage
+
+ void f1()
+ {
+ static stopwatch_accumulator<> t;
+ stopwatch_runner<stopwatch_accumulator<> > _(t);
+ // ...
+ }
+
+[endsect]
+[section:stopwatch_suspender Template Class `stopwatch_suspender<>`]
+
+This helper class ensures that the suspend/resume are pairwised. Suspends the associated __Stopwatch__ at construction time, and resumes it at destruction time.
+
+ template <class Stopwatch> class stopwatch_suspender {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_suspender(stopwatch & a, system::error_code & ec = throws());
+ ~stopwatch_suspender();
+ stopwatch_suspender() = delete;
+ stopwatch_suspender(const stopwatch_suspender&) = delete;
+ stopwatch_suspender& operator=(const stopwatch_suspender&) = delete;
+ }
+
+Usage
+
+ void f1()
+ {
+ static stopwatch_accumulator<> t;
+ stopwatch_runner<stopwatch_accumulator<> > _(t);
+ // ...
+
+ // call to some function we don't want to measure
+ {
+ stopwatch_suspender<stopwatch_accumulator<> > _(t);
+ external_function();
+ }
+ }
+
+[endsect]
+
+[section:stopwatch_resumer Template Class `stopwatch_resumer<>`]
+
+This helper class ensures that the resume/suspend are pairwised. Resumes the associated __Stopwatch__ at construction time, and suspends it at destruction time.
+
+ template <class Stopwatch> class stopwatch_resumer {
+ public:
+ typedef Stopwatch stopwatch;
+ stopwatch_resumer(stopwatch & a, system::error_code & ec = throws());
+ ~stopwatch_resumer();
+ stopwatch_resumer() = delete;
+ stopwatch_resumer(const stopwatch_resumer&) = delete;
+ stopwatch_resumer& operator=(const stopwatch_resumer&) = delete;
+ }
+
+Usage
+
+ void f1()
+ {
+ static stopwatch_accumulator<> t;
+ stopwatch_runner<stopwatch_accumulator<> > _(t);
+ // ...
+
+ // call to some function we don't want to measure
+ {
+ stopwatch_suspender<stopwatch_accumulator<> > _(t);
+
+ {
+ stopwatch_resumer<stopwatch_accumulator<> > _(t);
+
+ }
+ }
+ }
+
+[endsect]
+
+[endsect]
+
+[endsect]
+[section:reporters Stopwatch Reporters]
+[section:formatter_req `Formatter` Requirements]
+
+A Formatter outputs on a given ostream a formatted string combining informations from a Stopwatch and the format and the double precision.
+
+A Formatter must meet the requirements in the following Table.
+
+In this table `F` denote a Formatter type, `S` is a Stopwatch and `s` is an instance of `S`, `f` is `const char *` , `p` is and int, and `os` is a `std::ostream`, ec is a system::error_code
+
+[table Formatter Requirements
+ [[expression] [return type] [operational semantics]]
+ [[`F::default_os()`] [std::otream&] [The output stream.]]
+ [[`F::default_places()`] [`std::size_t`] [The precision when displaying a double.]]
+ [[`F::default_format()`] [`const char*`] [The default format.]]
+ [[`F::show_time(s,f,p,os,ec)`] [`S::time_point`] [outputs on `os` a formatted string combining informations from the Stopwatch `s`, the format `f` and the double precision `p`.]]
+]
+
+
+Models of `Formatter`:
+
+* __basic_stopwatch_formatter__
+* __basic_stopwatch_accumulator_formatter__
+* __basic_24_hours_formatter__
+
+[endsect]
+
+[section `Formatter` related traits]
+
+ template <class Stopwatch>
+ struct stopwatch_reporter_default_formatter {
+ typedef <see below> type;
+ };
+
+The nested typedef `type` defines the default formatter used by the __stopwatch_reporter__ class when the `Formatter` parameter is not explicit.
+
+[endsect]
+
+[section:reporters_req `Reporter` Requirements]
+
+A `Reporter` provides everything a __Stopwatch__ provides and adds reporting capabilities. The reporting is controleed by two parameters:
+
+A `Reporter` must meet the requirements in the following table in addition of the __Stopwatch__.
+The reporting is controleed by two parameters:
+
+* format : The output format
+* places(precision): the number of decimal placess used.
+
+And is sent to an output stream.
+
+In this table `R` denote Reporters types. `r` is an instance of `R`, ec is a system::error_code, os is an std::ostream, f is a std::string, p is an int. From the library perspective a Reporter needs to satisfy the following requirements.
+
+[table Reporter Requirements
+ [[expression] [return type] [operational semantics]]
+ [[`R::stopwatch`] [A model of __Stopwatch__.] [The Stopwatch associated to this Reporter.]]
+
+ [[`r.report()`] [`void`] [Creates a report.]]
+ [[`r.report(ec)`] [`void`] [Creates a report.]]
+ [[`r.reported()`] [`bool`] [The reporting has been done.]]
+]
+
+From the user point of view, the reporter provides often construction with any of the parameters controleed the reporting.
+
+[table Open Reporter Requirements
+ [[expression] [return type] [operational semantics]]
+ [[`R r`] [`R`] [Creates a Reporter.]]
+ [[`R r(ec)`] [`R`] [Creates a Reporter.]]
+
+ [[`R r(os)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,ec)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,f)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,f,ec)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,f,p)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,f,p,ec)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,p)`] [`R`] [Creates a Reporter.]]
+ [[`R r(os,p,ec)`] [`R`] [Creates a Reporter.]]
+
+ [[`R r(f)`] [`R`] [Creates a Reporter.]]
+ [[`R r(f,ec)`] [`R`] [Creates a Reporter.]]
+ [[`R r(f,p)`] [`R`] [Creates a Reporter.]]
+ [[`R r(f,p,ec)`] [`R`] [Creates a Reporter.]]
+
+ [[`R r(p)`] [`R`] [Creates a Reporter.]]
+ [[`R r(p,ec)`] [`R`] [Creates a Reporter.]]
+
+]
+
+[section:R Member Function `R()`]
+
+ void R(
+ [ std::ostream & os ]
+ [, const std::string & format]
+ [, int places]
+ [, system::error_code & ec = throws()]
+ );
+
+[*Effect:] Creates a reporter. All the parameters are optional.
+
+[*Throw:] Nothing.
+
+[endsect]
+
+[section:report Member Function `report()`]
+
+ void report(system::error_code & ec = throws());
+
+[*Effect:] Produce a report taking in account the ostream, format and place.
+
+[*Throw:] Any exception the `Formatter::show_time(*this,f,p,os,ec)` function can throw when `ec` is `throws()`.
+
+[endsect]
+[section:reported Member Function `reported()`]
+
+ bool reported();
+
+[*Returns:] True if the reportes has ben reported already.
+
+[*Throw:] Nothing.
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:stopwatch_reporter_hpp Header `<boost/chrono/stopwatches/stopwatch_reporter.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <class Stopwatch, class Formatter>
+ class basic_stopwatch_reporter;
+
+ template <class Stopwatch>
+ struct stopwatch_reporter_default_formatter;
+
+ template <class Stopwatch,
+ class Formatter=typename stopwatch_reporter_default_formatter<Stopwatch>::type>
+ class __stopwatch_reporter__;
+
+ template <class Stopwatch>
+ struct wstopwatch_reporter_default_formatter;
+
+ template <class Stopwatch,
+ class Formatter=typename wstopwatch_reporter_default_formatter<Stopwatch>::type>
+ class wstopwatch_reporter;
+ }}
+
+[section:basic_stopwatch_reporter Template Class `basic_stopwatch_reporter<>`]
+
+class `basic_stopwatch_reporter` provides everything a `Stopwatch` provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+* format : The output format
+* places(precision): the number of decimal placess used.
+
+The default places is given by Formatter::default_places().
+
+The default format is given by Formatter::default_format().
+
+ template <class Stopwatch, class Formatter>
+ class basic_stopwatch_reporter : public Stopwatch {
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+
+ explicit basic_stopwatch_reporter( system::error_code & ec = throws() );
+ explicit basic_stopwatch_reporter( std::ostream & os,
+ system::error_code & ec = throws() );
+
+ explicit basic_stopwatch_reporter( const std::string & format,
+ system::error_code & ec = throws() );
+ explicit basic_stopwatch_reporter( std::ostream & os, const std::string & format,
+ system::error_code & ec = throws() );
+
+ explicit basic_stopwatch_reporter( const std::string & format, int places,
+ system::error_code & ec = throws() );
+ explicit basic_stopwatch_reporter( std::ostream & os, const std::string & format, int places,
+ system::error_code & ec = throws() );
+
+ explicit basic_stopwatch_reporter( int places,
+ system::error_code & ec = throws() );
+ explicit basic_stopwatch_reporter( std::ostream & os, int places,
+ system::error_code & ec = throws() );
+
+ explicit basic_stopwatch_reporter( int places, const std::string & format,
+ system::error_code & ec = throws() );
+ explicit basic_stopwatch_reporter( std::ostream & os, int places, const std::string & format,
+ system::error_code & ec = throws() );
+
+ ~basic_stopwatch_reporter();
+
+ void report( system::error_code & ec = throws() );
+ bool reported() const;
+
+
+ typedef stopwatch_runner<basic_stopwatch_reporter<Stopwatch> > scoped_run;
+ typedef stopwatch_suspender<basic_stopwatch_reporter<Stopwatch> > scoped_suspend;
+ typedef stopwatch_resumer<basic_stopwatch_reporter<Stopwatch> > scoped_resume;
+ };
+
+[endsect]
+
+[section:stopwatch_reporter Template Class `stopwatch_reporter<>`]
+
+class __stopwatch_reporter__ provides a everything a `Stopwatch` provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+* format : The output format
+* places(precision): the number of decimal placess used.
+
+The default places is given by Formatter::default_places().
+
+The default format is given by Formatter::default_format().
+
+ template <class Stopwatch, class Formatter>
+ class stopwatch_reporter : public basic_stopwatch_reporter<Stopwatch,Formatter> {
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+
+ explicit stopwatch_reporter( system::error_code & ec = throws() );
+ explicit stopwatch_reporter( std::ostream & os,
+ system::error_code & ec = throws() );
+
+ explicit stopwatch_reporter( const std::string & format,
+ system::error_code & ec = throws() );
+ explicit stopwatch_reporter( std::ostream & os, const std::string & format,
+ system::error_code & ec = throws() );
+
+ explicit stopwatch_reporter( const std::string & format, int places,
+ system::error_code & ec = throws() );
+ explicit stopwatch_reporter( std::ostream & os, const std::string & format, int places,
+ system::error_code & ec = throws() );
+
+ explicit stopwatch_reporter( int places,
+ system::error_code & ec = throws() );
+ explicit stopwatch_reporter( std::ostream & os, int places,
+ system::error_code & ec = throws() );
+
+ explicit stopwatch_reporter( int places, const std::string & format,
+ system::error_code & ec = throws() );
+ explicit stopwatch_reporter( std::ostream & os, int places, const std::string & format,
+ system::error_code & ec = throws() );
+
+ ~stopwatch_reporter();
+
+ void report( system::error_code & ec = throws() );
+ bool reported() const;
+
+
+ typedef stopwatch_runner<stopwatch_reporter<Stopwatch> > scoped_run;
+ typedef stopwatch_suspender<stopwatch_reporter<Stopwatch> > scoped_suspend;
+ typedef stopwatch_resumer<stopwatch_reporter<Stopwatch> > scoped_resume;
+ };
+
+Usage
+
+ void f1()
+ {
+ typedef stopwatch_reporter<stopwatch_accumulator<> > accumulator;
+ static accumulator t;
+ accumulator::scoped_run _(t);
+ // ...
+
+ // call to some function we don't want to measure
+ {
+ accumulator::scoped_suspend _(t);
+ external_function();
+ }
+ }
+
+[endsect]
+
+[section:wstopwatch_reporter Template Class `wstopwatch_reporter<>`]
+
+class `wstopwatch_reporter` provides a everything a `Stopwatch` provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+
+* format : The output format
+* places(precision): the number of decimal placess used.
+
+The default places is given by Formatter::default_places().
+
+The default format is given by Formatter::default_format().
+
+ template <class Stopwatch, class Formatter>
+ class wstopwatch_reporter : public basic_wstopwatch_reporter<Stopwatch,Formatter> {
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+
+ explicit wstopwatch_reporter( system::error_code & ec = throws() );
+ explicit wstopwatch_reporter( std::ostream & os,
+ system::error_code & ec = throws() );
+
+ explicit wstopwatch_reporter( const std::string & format,
+ system::error_code & ec = throws() );
+ explicit wstopwatch_reporter( std::ostream & os, const std::string & format,
+ system::error_code & ec = throws() );
+
+ explicit wstopwatch_reporter( const std::string & format, int places,
+ system::error_code & ec = throws() );
+ explicit wstopwatch_reporter( std::ostream & os, const std::string & format, int places,
+ system::error_code & ec = throws() );
+
+ explicit wstopwatch_reporter( int places,
+ system::error_code & ec = throws() );
+ explicit wstopwatch_reporter( std::ostream & os, int places,
+ system::error_code & ec = throws() );
+
+ explicit wstopwatch_reporter( int places, const std::string & format,
+ system::error_code & ec = throws() );
+ explicit wstopwatch_reporter( std::ostream & os, int places, const std::string & format,
+ system::error_code & ec = throws() );
+
+ ~wstopwatch_reporter();
+
+ void report( system::error_code & ec = throws() );
+ bool reported() const;
+
+
+ typedef stopwatch_runner<wstopwatch_reporter<Stopwatch> > scoped_run;
+ typedef stopwatch_suspender<wstopwatch_reporter<Stopwatch> > scoped_suspend;
+ typedef stopwatch_resumer<wstopwatch_reporter<Stopwatch> > scoped_resume;
+ };
+
+Usage
+
+ void f1()
+ {
+ typedef wstopwatch_reporter<stopwatch_accumulator<> > accumulator;
+ static accumulator t;
+ accumulator::scoped_run _(t);
+ // ...
+
+ // call to some function we don't want to measure
+ {
+ accumulator::scoped_suspend _(t);
+ external_function();
+ }
+ }
+
+[endsect]
+
+[endsect]
+
+[/==================================================]
+[section:stopclock_hpp Header `<boost/chrono/stopwatches/stopclock.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template < class Clock, class Formatter > class basic_stopclock;
+ template < class Clock, class Formatter > class __stopclock__;
+ template < class Clock, class Formatter > class wstopclock;
+
+ typedef <see above> system_stopclock;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see above> steady_stopclock;
+ #endif
+ typedef <see above> high_resolution_stopclock;
+ typedef <see above> process_real_cpu_stopclock;
+ typedef <see above> process_user_cpu_stopclock;
+ typedef <see above> process_system_cpu_stopclock;
+
+ typedef <see above> system_wstopclock;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see above> steady_wstopclock;
+ #endif
+ typedef <see above> high_resolution_wstopclock;
+ typedef <see above> process_real_cpu_wstopclock;
+ typedef <see above> process_user_cpu_wstopclock;
+ typedef <see above> process_system_cpu_wstopclock;
+ }}
+
+[section:basic_stopclock Template Class `basic_stopclock<>`]
+
+`basic_stopclock<Clock,Formatter>` template class is a shortcut of `basic_stopwatch_reporter<stopwatch<Clock,Formatter>>`
+
+ template< class Clock, class Formatter>
+ class basic_stopclock : public basic_stopwatch_reporter<stopwatch<Clock>, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit basic_stopclock( system::error_code & ec = throws() );
+ explicit basic_stopclock( ostream_type & os,
+ system::error_code & ec = throws() );
+ explicit basic_stopclock( const string_type & format,
+ system::error_code & ec = throws() );
+ explicit basic_stopclock( int places,
+ system::error_code & ec = throws() );
+
+ basic_stopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = throws() );
+ basic_stopclock( const string_type & format, int places,
+ system::error_code & ec = throws() );
+ basic_stopclock( ostream_type & os, int places,
+ system::error_code & ec = throws() );
+ basic_stopclock( int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+ basic_stopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = throws() );
+ basic_stopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+
+[section:stopclock Template Class `stopclock<>`]
+
+A stopclock is a stopwatch with the ability to report elapsed time on an output stream.
+`stopclock<Clock>` template class is a shortcut of `basic_stopclock<Clock, typename stopwatch_reporter_default_formatter<stopwatch<Clock>>::type>` with a specific default formatter.
+
+ template
+ < class Clock=process_cpu_clock
+ , class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock>>::type
+ > class stopclock : public basic_stopclock<Clock, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit stopclock( system::error_code & ec = throws() );
+ explicit stopclock( ostream_type & os,
+ system::error_code & ec = throws() );
+ explicit stopclock( const string_type & format,
+ system::error_code & ec = throws() );
+ explicit stopclock( int places,
+ system::error_code & ec = throws() );
+
+ stopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = throws() );
+ stopclock( const string_type & format, int places,
+ system::error_code & ec = throws() );
+ stopclock( ostream_type & os, int places,
+ system::error_code & ec = throws() );
+ stopclock( int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+ stopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = throws() );
+ stopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+[section:typedefs `stopclock` useful typedefs]
+
+The library provides stopclock shortcuts for all the models of __Clock__, replacing clock by stopclock.
+
+ typedef boost::chrono::stopclock< boost::chrono::system_clock >
+ system_stopwatch_stopclock;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::stopclock< boost::chrono::steady_clock >
+ steady_stopwatch_stopclock;
+ #endif
+ typedef boost::chrono::stopclock< boost::chrono::high_resolution_clock >
+ high_resolution_stopclock;
+ typedef boost::chrono::stopclock< boost::chrono::process_real_cpu_clock >
+ process_real_cpu_stopclock;
+ typedef boost::chrono::stopclock< boost::chrono::process_user_cpu_clock >
+ process_user_cpu_stopclock;
+ typedef boost::chrono::stopclock< boost::chrono::process_system_cpu_clock >
+ process_system_cpu_stopclock;
+
+[endsect]
+
+[section:wstopclock Template Class `wstopclock<>`]
+
+`wstopclock<Clock>` template class is a shortcut of `basic_wstopclock<Clock, typename stopwatch_reporter_default_formatter<stopwatch<Clock>>::type>` with a specific default formatter.
+
+ template
+ < class Clock=process_cpu_clock
+ , class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock>>::type
+ > class wstopclock : public basic_wstopclock<Clock, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopclock( system::error_code & ec = throws() );
+ explicit wstopclock( ostream_type & os,
+ system::error_code & ec = throws() );
+ explicit wstopclock( const string_type & format,
+ system::error_code & ec = throws() );
+ explicit wstopclock( int places,
+ system::error_code & ec = throws() );
+
+ wstopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = throws() );
+ wstopclock( const string_type & format, int places,
+ system::error_code & ec = throws() );
+ wstopclock( ostream_type & os, int places,
+ system::error_code & ec = throws() );
+ wstopclock( int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+ wstopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = throws() );
+ wstopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+[section:wtypedefs `wstopclock` useful typedefs]
+
+The library provides wstopclock shortcuts for all the models of __Clock__, replacing clock by wstopclock.
+
+ typedef boost::chrono::wstopclock< boost::chrono::system_clock >
+ system_wstopclock;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::wstopclock< boost::chrono::steady_clock >
+ steady_wstopclock;
+ #endif
+ typedef boost::chrono::wstopclock< boost::chrono::high_resolution_clock >
+ high_resolution_wstopclock;
+ typedef boost::chrono::wstopclock< boost::chrono::process_real_cpu_clock >
+ process_real_cpu_wstopclock;
+ typedef boost::chrono::wstopclock< boost::chrono::process_user_cpu_clock >
+ process_user_cpu_wstopclock;
+ typedef boost::chrono::wstopclock< boost::chrono::process_system_cpu_clock >
+ process_system_cpu_wstopclock;
+
+[endsect]
+
+
+[endsect]
+
+[/==================================================]
+[section:stopclock_accumulator_hpp Header `<boost/chrono/stopwatches/stopclock_accumulator.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template < class Clock, class Formatter >
+ class basic_stopclock_accumulator;
+ template < class Clock, class Formatter >
+ class __stopclock_accumulator__;
+ template < class Clock, class Formatter >
+ class wstopclock_accumulator;
+
+ typedef <see above> system_stopclock_accumulator;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see above> steady_stopclock_accumulator;
+ #endif
+ typedef <see above> high_resolution_stopclock_accumulator;
+ typedef <see above> process_real_cpu_stopclock_accumulator;
+ typedef <see above> process_user_cpu_stopclock_accumulator;
+ typedef <see above> process_system_cpu_stopclock_accumulator;
+
+ typedef <see above> system_wstopclock_accumulator;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef <see above> steady_wstopclock_accumulator;
+ #endif
+ typedef <see above> high_resolution_wstopclock_accumulator;
+ typedef <see above> process_real_cpu_wstopclock_accumulator;
+ typedef <see above> process_user_cpu_wstopclock_accumulator;
+ typedef <see above> process_system_cpu_wstopclock_accumulator;
+ }}
+
+[section:basic_stopclock_accumulator Template Class `basic_stopclock_accumulator<>`]
+
+`basic_stopclock_accumulator<Clock>` template class is a shortcut of `basic_stopwatch_reporter<stopwatch_accumulator<Clock>, typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock>>::type>`
+
+ template
+ < class Clock=high_resolution_clock
+ , class Formatter=
+ typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock>>::type
+ > class basic_stopclock_accumulator
+ : public basic_stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit basic_stopclock_accumulator( system::error_code & ec = throws() );
+ explicit basic_stopclock_accumulator( ostream_type & os,
+ system::error_code & ec = throws() );
+ explicit basic_stopclock_accumulator( const string_type & format,
+ system::error_code & ec = throws() );
+ explicit basic_stopclock_accumulator( int places,
+ system::error_code & ec = throws() );
+
+ basic_stopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = throws() );
+ basic_stopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = throws() );
+ basic_stopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = throws() );
+ basic_stopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+ basic_stopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = throws() );
+ basic_stopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+
+[section:stopclock_accumulator Template Class `stopclock_accumulator<>`]
+
+`stopclock_accumulator<Clock>` template class is a shortcut of `stopwatch_reporter<stopwatch<Clock>>` with a specific formatter.
+
+ template
+ < class Clock=high_resolution_clock
+ , class Formatter=
+ typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock>>::type
+ > class stopclock_accumulator
+ : public basic_stopclock_accumulator<Clock, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit stopclock_accumulator( system::error_code & ec = throws() );
+ explicit stopclock_accumulator( ostream_type & os,
+ system::error_code & ec = throws() );
+ explicit stopclock_accumulator( const string_type & format,
+ system::error_code & ec = throws() );
+ explicit stopclock_accumulator( int places,
+ system::error_code & ec = throws() );
+
+ stopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = throws() );
+ stopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = throws() );
+ stopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = throws() );
+ stopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+ stopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = throws() );
+ stopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+[section:typedefs `stopclock_accumulator` useful typedefs]
+
+The library provides stopclock_accumulator shortcuts for all the models of __Clock__, replacing clock by stopclock_accumulator.
+
+
+ typedef boost::chrono::stopclock_accumulator< boost::chrono::system_clock >
+ system_stopclock_accumulator;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::stopclock_accumulator< boost::chrono::steady_clock >
+ steady_stopclock_accumulator;
+ #endif
+ typedef boost::chrono::stopclock_accumulator< boost::chrono::high_resolution_clock >
+ high_resolution_stopclock_accumulator;
+ typedef boost::chrono::stopclock_accumulator< boost::chrono::process_real_cpu_clock >
+ process_real_cpu_stopclock_accumulator;
+ typedef boost::chrono::stopclock_accumulator< boost::chrono::process_user_cpu_clock >
+ process_user_cpu_stopclock_accumulator;
+ typedef boost::chrono::stopclock_accumulator< boost::chrono::process_system_cpu_clock >
+ process_system_cpu_stopclock_accumulator;
+
+[endsect]
+[section:wstopclock_accumulator Template Class `wstopclock_accumulator<>`]
+
+`wstopclock_accumulator<Clock>` template class is a shortcut of `stopwatch_reporter<stopwatch<Clock>>` with a specific formatter.
+
+ template
+ < class Clock=high_resolution_clock
+ , class Formatter=
+ typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock>>::type
+ > class wstopclock_accumulator
+ : public basic_wstopclock_accumulator<Clock, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopclock_accumulator( system::error_code & ec = throws() );
+ explicit wstopclock_accumulator( ostream_type & os,
+ system::error_code & ec = throws() );
+ explicit wstopclock_accumulator( const string_type & format,
+ system::error_code & ec = throws() );
+ explicit wstopclock_accumulator( int places,
+ system::error_code & ec = throws() );
+
+ wstopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = throws() );
+ wstopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = throws() );
+ wstopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = throws() );
+ wstopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+ wstopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = throws() );
+ wstopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = throws() );
+
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+[section:wtypedefs `wstopclock_accumulator` useful typedefs]
+
+The library provides wstopclock_accumulator shortcuts for all the models of __Clock__, replacing clock by wstopclock_accumulator.
+
+ typedef boost::chrono::wstopclock_accumulator< boost::chrono::system_clock >
+ system_wstopclock_accumulator;
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::wstopclock_accumulator< boost::chrono::steady_clock >
+ steady_wstopclock_accumulator;
+ #endif
+ typedef boost::chrono::wstopclock_accumulator< boost::chrono::high_resolution_clock >
+ high_resolution_wstopclock_accumulator;
+ typedef boost::chrono::wstopclock_accumulator< boost::chrono::process_real_cpu_clock >
+ process_real_cpu_wstopclock_accumulator;
+ typedef boost::chrono::wstopclock_accumulator< boost::chrono::process_user_cpu_clock >
+ process_user_cpu_wstopclock_accumulator;
+ typedef boost::chrono::wstopclock_accumulator< boost::chrono::process_system_cpu_clock >
+ process_system_cpu_wstopclock_accumulator;
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:scoped_stopclock_hpp Header `<boost/chrono/stopwatches/scoped_stopclock.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template < class Clock, class Formatter > class scoped_stopclock;
+ }}
+
+[section:scoped_stopclock Template Class `scoped_stopclock<>`]
+
+`scoped_stopclock<>`is like a `stopclock<>` but that in addition will output a scoped trace. At construction time it will output
+
+ {{{ <string>
+
+and at destruction time
+
+ }}} <string> <output of stopwatch_reporter>
+
+A typical ussage of this class is
+
+ int f1(long j)
+ {
+ scoped_stopclock<> _(BOOST_CURRENT_FUNCTION);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+
+
+[heading Synopsis]
+
+ template < class Clock=process_cpu_clock
+ , class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock>>::type
+ > class scoped_stopclock
+ : public stopwatch_reporter<stopwatch<Clock>, Formatter> {
+ public:
+ typedef Clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit scoped_stopclock( const std::string& func,
+ system::error_code & ec = throws() );
+ scoped_stopclock( const std::string& func, ostream_type & os,
+ system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, const string_type & format,
+ system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, int places,
+ system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, ostream_type & os,
+ const string_type & format,
+ system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, const string_type & format,
+ int places, system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, ostream_type & os, int places,
+ system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, int places,
+ const string_type & format, system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, ostream_type & os,
+ const string_type & format, int places,
+ system::error_code & ec = throws() );
+
+ scoped_stopclock( const std::string& func, ostream_type & os, int places,
+ const string_type & format, system::error_code & ec = throws() );
+
+ ~scoped_stopclock();
+
+ typedef typename base_type::scoped_run scoped_run;
+ typedef typename base_type::scoped_suspend scoped_suspend;
+ typedef typename base_type::scoped_resume scoped_resume;
+ };
+
+[endsect]
+
+[endsect]
+[endsect]
+[section:formatters Stopwatch Formatters]
+
+[/==================================================]
+[section:stopwatch_formatter_hpp Header `<boost/chrono/stopwatches/stopwatch_formatter.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_stopwatch_formatter;
+
+ typedef basic_stopwatch_formatter<char> stopwatch_formatter;
+ typedef basic_stopwatch_formatter<wchar_t> wstopwatch_formatter;
+ }}
+
+[section:basic_stopwatch_formatter Template Class `basic_stopwatch_formatter<>`]
+
+`stopwatch_formatter` is a model of __Formatter__.
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_stopwatch_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+ static ostream_type & default_os();
+ static const char_type * default_format();
+ static int default_places();
+
+ template < class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char * format, int places,
+ std::ostream & os, system::error_code & ec);
+ };
+
+The default places is given by default_places and is 3.
+
+The default format is "%ts\\n", where
+
+* `%d` : the result of elapsed() when the reporting is done.
+
+The time is given using the suffix "s" following the System International d'Unites Std.
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:stopwatch_accumulator_formatter_hpp Header `<boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ > basic_stopwatch_accumulator_formatter;
+ typedef basic_stopwatch_accumulator_formatter<char> stopwatch_accumulator_formatter;
+ typedef basic_stopwatch_accumulator_formatter<wchar_t> wstopwatch_accumulator_formatter;
+ }}
+
+[section:basic_stopwatch_accumulator_formatter Template Class `basic_stopwatch_accumulator_formatter<>`]
+
+`basic_stopwatch_accumulator_formatter` is a model of __Formatter__
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ class basic_stopwatch_accumulator_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+ static ostream_type & default_os();
+ static const char_type * default_format();
+ static int default_places();
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char * format, int places,
+ std::ostream & os, system::error_code & ec);
+ };
+
+The default places is given by default_places and is 3.
+
+The default format is "%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fHz, lifetime=%ls, percentage=%p\%\\n", where
+
+* `%c` : the counter of the number of times the pair srat/stop has been called.
+* `%s` : the sum of the samples of elapsed time between the call to start/stop.
+* `%m` : the min of the samples of elapsed time between the call to start/stop.
+* `%M` : the max of the samples of elapsed time between the call to start/stop.
+* `%a` : the mean of the samples of elapsed time between the call to start/stop.
+* `%f` : the frequency of calls to start.
+* `%l` : the lifetime of the stopwatch_accumulator.
+* `%p` : the percentage of time spent by this stopwatch respect to its lifetime.
+
+The time is given using the suffix "s", the frequency is given using the suffix "Hz", both following the System International d'Unites Std.
+
+[endsect]
+
+[section:typedefs `basic_stopwatch_accumulator_formatter` useful typedefs]
+
+The library provides basic_stopwatch_accumulator_formatter shortcuts for char and wchar_t.
+
+ typedef basic_stopwatch_accumulator_formatter<char>
+ stopwatch_accumulator_formatter;
+ typedef basic_stopwatch_accumulator_formatter<wchar_t>
+ wstopwatch_accumulator_formatter;
+
+
+[endsect]
+[endsect]
+[/==================================================================]
+[section:time_formatter_hpp Header `<boost/chrono/stopwatches/time_formatter.hpp>`]
+[/==================================================================]
+
+ namespace boost { namespace chrono {
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_time_formatter;
+
+ typedef basic_time_formatter<char> time_formatter;
+ typedef basic_time_formatter<wchar_t> wtime_formatter;
+
+ template <>
+ struct stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> > {
+ typedef time_formatter type;
+ };
+
+ } }
+
+[section:basic_time_formatter Template Class `basic_time_formatter<>`]
+
+`basic_time_formatter` is a model of __Formatter__.
+
+ template <typename CharT, typename Traits, class Alloc>
+ class basic_time_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+ static ostream_type & default_os();
+ static const char_type * default_format();
+ static int default_places();
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_
+ , const char * format, int places, std::ostream & os
+ , system::error_code & ec);
+ };
+
+The default places is given by default_places and is 3.
+
+The default format is "nreal %rs, cpu %cs (%p%), user %us, system %ss\\n", where
+
+* `%r` : real process clock
+* `%u` : user process clock
+* `%s` : system process clock
+* `%c` : user+system process clock
+* `%p` : percentage (user+system)/real process clock
+
+All the units are given using the suffix "s" following the System International d'Unites Std.
+
+[endsect]
+
+[section:typedefs `basic_time_formatter` useful typedefs]
+
+The library provides basic_time_formatter shortcuts for char and wchar_t.
+
+ typedef basic_time_formatter<char> time_formatter;
+ typedef basic_time_formatter<wchar_t> wtime_formatter;
+
+[endsect]
+
+[section:spec `stopwatch_reporter_default_formatter` Specialization]
+
+ template <>
+ struct stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> > {
+ typedef time_formatter type;
+ };
+
+[endsect]
+
+
+[endsect]
+
+[/==================================================]
+[section:stopwatch_accumulator_time_formatter_hpp Header `<boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ > basic_stopwatch_accumulator_time_formatter;
+ typedef basic_stopwatch_accumulator_time_formatter<char> stopwatch_accumulator_time_formatter;
+ typedef basic_stopwatch_accumulator_time_formatter<wchar_t> wstopwatch_accumulator_time_formatter;
+ }}
+
+[section:basic_stopwatch_accumulator_time_formatter Template Class `basic_stopwatch_accumulator_time_formatter<>`]
+
+`basic_stopwatch_accumulator_time_formatter` is a model of __Formatter__
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ class basic_stopwatch_accumulator_time_formatter {
+ public:
+ typedef std::basic_string<CharT,Traits,Alloc> string_type;
+ typedef CharT char_type;
+ typedef std::basic_ostream<CharT,Traits> ostream_type;
+ static ostream_type & default_os();
+ static const char_type * default_format();
+ static int default_places();
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char * format, int places,
+ std::ostream & os, system::error_code & ec);
+ };
+
+The default places is given by default_places and is 3.
+
+The default format is "%c times, sum=%s, min=%m, max=%M, mean=%a, frequency=%fHz, lifetime=%ls, percentage=%p\%\\n|real %rs, cpu %cs (%p%), user %us, system %ss", where
+
+The part before the '|' corresponds to the accumulator format and the part after corresponds to the times format, which will be used for the sum, max, min and mean statistics.
+
+* `%c` : the counter of the number of times the pair srat/stop has been called.
+* `%s` : the sum of the samples of elapsed time between the call to start/stop.
+* `%m` : the min of the samples of elapsed time between the call to start/stop.
+* `%M` : the max of the samples of elapsed time between the call to start/stop.
+* `%a` : the mean of the samples of elapsed time between the call to start/stop.
+* `%f` : the frequency of calls to start.
+* `%l` : the lifetime of the stopwatch_accumulator.
+* `%p` : the percentage of time spent by this stopwatch respect to its lifetime.
+
+* `%r` : real process clock
+* `%u` : user process clock
+* `%s` : system process clock
+* `%c` : user+system process clock
+* `%p` : percentage (user+system)/real process clock
+
+The time is given using the suffix "s", the frequency is given using the suffix "Hz", both following the System International d'Unites Std.
+
+
+[endsect]
+
+[section:typedefs `basic_stopwatch_accumulator_time_formatter` useful typedefs]
+
+The library provides basic_stopwatch_accumulator_time_formatter shortcuts for char and wchar_t.
+
+ typedef basic_stopwatch_accumulator_time_formatter<char>
+ stopwatch_accumulator_time_formatter;
+ typedef basic_stopwatch_accumulator_time_formatter<wchar_t>
+ wstopwatch_accumulator_time_formatter;
+
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:t24_hours_hpp Header `<boost/chrono/stopwatches/t24_hours.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ class t24_hours;
+ }}
+
+[section:t24_hours Class `t24_hours`]
+
+`t24_hours` helper class decompose a duration in days, hours, minutes, seconds and nanoseconds. It can be used through its static functions or creating an instance and using its fields.
+
+ class t24_hours {
+ public:
+ typedef boost::chrono::duration<boost::int_least32_t, __ratio__<24*3600> > days;
+ typedef boost::chrono::hours hours;
+ typedef boost::chrono::minutes minutes;
+ typedef boost::chrono::seconds seconds;
+ typedef boost::chrono::nanoseconds nanoseconds;
+
+ template <class Rep, class Period>
+ static days get_days(const boost::chrono::duration<Rep, Period>& d);
+
+ template <class Rep, class Period>
+ static hours get_hours(const boost::chrono::duration<Rep, Period>& d);
+
+ template <class Rep, class Period>
+ static minutes get_minutes(const boost::chrono::duration<Rep, Period>& d);
+
+ template <class Rep, class Period>
+ static seconds get_seconds(const boost::chrono::duration<Rep, Period>& d);
+
+ template <class Rep, class Period>
+ static nanoseconds get_nanoseconds(const boost::chrono::duration<Rep, Period>& d);
+
+ days days_;
+ hours hours_;
+ minutes minutes_;
+ seconds seconds_;
+ nanoseconds nanoseconds_;
+
+ template <class Rep, class Period>
+ explicit t24_hours(const boost::chrono::duration<Rep, Period>& d);
+ };
+
+[endsect]
+[endsect]
+
+[/==================================================================]
+[section:t24_hours_formatter_hpp Header `<boost/chrono/stopwatches/t24_hours_formatter.hpp>`]
+[/==================================================================]
+
+
+ namespace boost { namespace chrono {
+
+ template <
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
+ class Alloc=std::allocator<CharT>
+ >
+ class basic_24_hours_formatter;
+
+ typedef basic_24_hours_formatter<char> t24_hours_formatter;
+ typedef basic_24_hours_formatter<wchar_t> wt24_hours_formatter;
+
+ } }
+
+[section:basic_24_hours_formatter Template Class `basic_24_hours_formatter<>`]
+
+`basic_24_hours_formatter` is a model of __Formatter__.
+
+ template <typename CharT, typename Traits, class Alloc>
+ class basic_24_hours_formatter {
+ public:
+ static std::ostream & default_os();
+ static const char * default_format();
+ static int default_places();
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_
+ , const char * format, int places, std::ostream & os
+ , system::error_code & ec);
+ };
+
+The default places is given by default_places and is 3.
+
+The default format is "%d days(s) %h:%m:%s.%n\\n", where
+
+* `%d` : days
+* `%h` : hours
+* `%m` : minutes
+* `%s` : seconds
+* `%n` : nanoseconds
+
+[endsect]
+
+[section:typedefs `basic_24_hours_formatter` useful typedefs]
+
+The library provides basic_24_hours_formatter shortcuts for char and wchar_t.
+
+ typedef basic_24_hours_formatter<char> t24_hours_formatter;
+ typedef basic_24_hours_formatter<wchar_t> wt24_hours_formatter;
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+[endsect]
+
+[/=================]
+[section Appendices]
+[/=================]
+[/==================================]
+[section:history Appendix A: History]
+[/==================================]
+
+[section [*Version 0.3.0, September 6, 2011] ]
+
+[*Features:]
+
+* Reinsertion of Boost.Stopwatches as a sub-library of Boost.Chrono.
+* Rename boost::stopwatches namespace to boost::chrono
+[/* Extraction of the reporting capabilities, which are not yet enough mure. ]
+
+[endsect]
+
+
+[section [*Version 0.2.0, Feb 6, 2011] ]
+
+[*Features:]
+
+* Adaptation to new Boost.Chrono interface.
+
+[endsect]
+
+
+[section [*Version 0.1.0, September 10, 2010] ]
+
+[*Features:]
+
+* Extraction from Boost.Chrono of Boost.Stopwatches
+
+[endsect]
+
+
+[endsect]
+
+[/======================================]
+[section:rationale Appendix B: Rationale]
+
+[heading How reliable are these measures?]
+
+[/note this section need to be reworked, the ideas are there, but ...]
+
+
+There are three cases which can lead to get unreliable measures:
+
+* It is not possible to measure events that transpire at rates of the same order of magnitude as the clock's precision with any reliability. For example, a 10ms clock cannot be used reliably to measure elapsed times of tens of milliseconds. The library provides a [high_resolution_clock] that gives you the highest resolution time available on your platform. That will give the best precision, but can only be used for reliable measurement of events that elapse about an order of magnitude slower than that clock's precision.
+
+
+``
+#include <boost/chrono/chrono.hpp>
+ ...
+ __stopclock__<__high_resolution_clock__> _;
+``
+
+* Using a process clock in a multithreaded application will give elapsed time for the process as a whole, including threads other than the calling thread. To get time elapsed for a specific thread, use the supplied __thread_clock__ which returns time elapsed for the calling thread only, if supported by the platform.
+
+* When stopclocks are nested, usually from stopclocks appearing in each of several nested function calls, the overhead of the stopclock processing begins to be significant relative to run time of the code being measured. The innermost measurements remain accurate, but those in the outermost layers can measure too much overhead to be trustworthy.
+
+* Nested stopclocks (usually nested function calls where each function contains a stopclock). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
+
+
+Most of the stopclock overhead is likely due to logging. There are two things we can do to make the difference :
+
+* Don't flush log information while measuring elapsed time. A __stopwatch_accumulator__ can make that possible, because it don't report until all the measures have been compiled and then report some statistics. Alternatively, an asynchronous stream would permit normal logging but by a thread other than the one being measured.
+
+* Add a mechanism to track the difference between the application time and stopclock time. If a __Clock__ models __SuspendibleClock__ and its precision is sufficiently fine, this mechanism could suspend the __Clock_s__ counting while reporting measurements and resume it thereafter.
+
+[/
+ stopclock<suspendible_clock<Clock> > _;
+
+
+See the performances section for more deep details.
+]
+
+
+[endsect]
+
+[/======================================================]
+[section:implementation Appendix C: Implementation Notes]
+
+
+
+[endsect]
+
+[/======================================================]
+[section:faq Appendix D: FAQ]
+
+
+[heading Why does stopwatch_reporter only display millisecond place precision when the underlying Clock has nanosecond precision?]
+
+To avoid giving the impression of precision where none exists. See Caveat emptor. You can always specify additional decimal places if you want to live dangerously.
+
+[heading Why does stopwatch_reporter sometimes report more cpu seconds than real seconds?]
+
+Ask your operating system supplier. The results have been inspected with a debugger, and both for Windows and Linux, that's what the OS appears to be reporting at times.
+
+[heading Can I obtain statistics of the time elapsed between calls to a function?]
+
+The library does not provides this feature.
+
+[heading What happens if I press Ctrl+C and program terminates? What log would Boost.Stopwatches output?]
+
+
+[endsect]
+
+[/====================================================]
+[section:acknowledgements Appendix E: Acknowledgements]
+
+The library's started from the Beman Dawes `timer<>`, `process_clock`, `process_timer`, `run_timer` classes which are now deprecated and replaced by the __stopwatch__, `process_cpu_clock` and `stopclock` classes.
+
+Thanks to Adrew Chinoff for its multiple suggestion on __stopwatch_accumulator__, and helping me to polish the documentation.
+
+Thanks to Tom Tan for reporting some compiler issues with MSVC V10 beta and MinGW-gcc-4.4.0 and for the many suggestion he did concerning the __stopwatch__, __lightweight_stopwatch__, and __stopclock__ classes and a deep help with wide characters implementation.
+
+Thanks to Ronald Bock for reporting Valgind issues and for the many suggestion he did concerning the documentation.
+
+[endsect]
+
+[/====================================================]
+[section:tests Appendix F: Tests]
+
+In order to test you need to do.
+
+ bjam libs/chrono/stopwatches/test
+
+You can also run a specific suite of test by doing
+
+ cd libs/chrono/stopwatches/test
+ bjam stopwatch
+
+
+[section stopwatch]
+[table
+ [[Name] [kind] [Description] [Result] [Ticket]]
+ [[test_min_max] [compile] [test compilation succeeds in the presence of macros min and max.] [Pass] [#]]
+ [[stopwatch_example] [run] [...] [Pass] [#]]
+ [[scoped_stopwatch_example] [run] [...] [Pass] [#]]
+ [[stopwatch_accumulator_example] [run] [...] [Pass] [#]]
+ [[specific_stopwatch_accumulator_example] [run] [...] [Pass] [#]]
+ [[stopclock_example] [run] [...] [Pass] [#]]
+ [[stopclock_accumulator_example] [run] [...] [Pass] [#]]
+ [[nested_stopclock_accumulator_example] [run] [...] [Pass] [#]]
+ [[loop_stopclock_accumulator_example] [run] [...] [Pass] [#]]
+ [[t24_hours_example] [run] [...] [Pass] [#]]
+ [[scoped_stopclock_example] [run] [...] [Pass] [#]]
+ [[timex] [link] [...] [Pass] [#]]
+ [[stopclock_constructor_overload_test] [run] [...] [Pass] [#]]
+ [[wstopclock_constructor_overload_test] [run] [...] [Pass] [#]]
+
+]
+[endsect]
+
+[endsect]
+[/=====================================]
+[section:tickets Appendix G: Tickets]
+
+[table
+ [[Ticket] [Description] [Resolution] [State]]
+
+ [[1] [suspend doesn't works: partial_ not initialized] [initialize with duration::zero()] [Closed]]
+ [[2] [suspend doesn't works: elapsed doesn't take care of partial_] [take care of partial] [Closed]]
+ [[3] [suspend doesn't works: bad use of system::error_code & ec] [replace by system::error_code ec] [Closed]]
+ [[4] [Use of Specific formatters doesn't works] [] [Closed]]
+
+ [[5] [boost/chrono/scoped_suspend.hpp(31) : warning C4520: 'boost::chrono::scoped_suspend<Clock>' : multiple default constructors specified
+] [Remove the default constructor deletion ] [Closed]]
+ [[6] [suspendible_clock_test doesn't works in my mingw environement] [(issue with tss)] [*Open*]]
+ [[7] [error_code not initialized] [Use ec.clear() before throwing a exception.] [Closed]]
+ [[8] [Valgrind issue: Conditional jump or move depends on uninitialised value(s)] [Replace the test] [Closed]]
+ [/[#] [XXXX] [XXXX] [Closed]]
+]
+
+
+
+
+
+[endsect]
+
+[/=====================================]
+[section:perf Appendix H: Performances]
+[/=====================================]
+
+
+We have run some program changing how the reporting is done.
+
+NONE: no report is done on the inner function
+HIGH: every call to the recursive function is reported using an stopclock
+SUSPEND: every call to the recursive function is reported using a using an stopclock on a suspendible clock
+ACCU: every call to the recursive function is tracked using a stopclock_accumulator
+
+We have run the programm with two different clocks, high_resolution_clock and thread_clock.
+
+The programs are either single-threaded or multi-threaded.
+
+Two kind of inner functions are used: recursive or non recursive. In order to test the influence of nesting reports, the non recursive functions use up to 10 nesting levels, depending on its parameter.
+
+the function at level n is defined as follows
+
+ void fn(long v) {
+ // reporting or not
+ stopclock<> _;
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v==0) return;
+
+ if (v%(n-1)==0) fn-1(v-1);
+ if (v%(n-2)==0) fn-2(v-1);
+ ...
+ f1(v-1);
+ }
+
+This gives a variable number in nesting reporting depending on the parameter, with a variable lifetime.
+
+[heading Single-Threaded Recursive function]
+
+We have run the same program and changed how the reporting is done.
+
+The programm creates two thread of execution. the thread entry point calls a function which makes some calculation depending on its parameter and call recursivelly itself decreasing the parameter.
+
+NONE: no report is done on the inner function
+HIGH: every call to the recursive function is reported using an stopclock
+SUSPEND: every call to the recursive function is reported using a using an stopclock on a suspendible clock
+ACCU: every call to the recursive function is tracked using a stopclock_accumulator
+
+We have run the programm with two different clocks, high_resolution_clock and thread_clock.
+
+[heading Multi-Threaded Recursive function]
+
+We have run the same program and changed how the reporting is done.
+
+The programm creates two thread of execution. the thread entry point calls a function which makes some calculation depending on its parameter and call recursivelly itself decreasing the parameter.
+
+NONE: no report is done on the inner function
+HIGH: every call to the recursive function is reported using an stopclock
+SUSPEND: every call to the recursive function is reported using a using an stopclock on a suspendible clock
+ACCU: every call to the recursive function is tracked using a stopclock_accumulator
+
+We have run the programm with two different clocks, high_resolution_clock and thread_clock.
+
+[endsect]
+
+[/=====================================]
+[section:todo Appendix I: Future plans]
+[/=====================================]
+[heading Tasks to do]
+
+* Complete documentation
+* Fully implement error handling, with test cases.
+* Fix open isues.
+
+[endsect]
+[endsect]
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/loop_stopclock_accumulator_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/loop_stopclock_accumulator_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,39 @@
+// stopwatch_accumulator_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+//#include <boost/chrono/stopclock_accumulator.hpp>
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+
+#include <cmath>
+#include "sleep_for.hpp"
+
+using namespace boost::chrono;
+
+int f1(long j)
+{
+ stopclock_accumulator<> acc(BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT);
+ for ( long i = 0; i < j; ++i ) {
+ stopclock_accumulator<>::scoped_run _(acc);
+ //~ std::cout << "i="<<i <<" ";
+ //~ std::cout << " j="<<j <<" ";
+ //~ stopclock<> s;
+ std::sqrt( 123.456L ); // burn some time
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(20));
+ }
+
+
+ return 0;
+}
+int main()
+{
+ static stopclock_accumulator<> acc(BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT);
+ stopclock_accumulator<>::scoped_run _(acc);
+
+ f1(100);
+ f1(200);
+ f1(300);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/nested_stopclock_accumulator_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/nested_stopclock_accumulator_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,66 @@
+// stopwatch_accumulator_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches.hpp>
+#include <cmath>
+#include "sleep_for.hpp"
+
+using namespace boost::chrono;
+
+#define BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR \
+ static stopclock_accumulator<> BOOST_JOIN(_boost_chrono_stopclock_accumulator_, __LINE__)( \
+ std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] " + stopwatch_accumulator_formatter::default_format() \
+ ); \
+ stopclock_accumulator<>::scoped_run BOOST_JOIN(_boost_chrono_stopclock_accumulator_run_, __LINE__)(BOOST_JOIN(_boost_chrono_stopclock_accumulator_, __LINE__))
+
+#define BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_FCT \
+ static stopclock_accumulator<> BOOST_JOIN(_boost_chrono_stopclock_accumulator_, __LINE__)( \
+ std::string(BOOST_CURRENT_FUNCTION) + ": " + stopwatch_accumulator_formatter::default_format() \
+ ); \
+ stopclock_accumulator<>::scoped_run BOOST_JOIN(_boost_chrono_stopclock_accumulator_run_, __LINE__)(BOOST_JOIN(_boost_chrono_stopclock_accumulator_, __LINE__))
+
+#define BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_FCT_REVERSE \
+ static boost::chrono::stopclock_accumulator<> BOOST_JOIN(_boost_chrono_stopclock_accumulator_, __LINE__)( \
+ std::string(BOOST_CURRENT_FUNCTION) + "(between calls): " + boost::chrono::stopwatch_accumulator_formatter::default_format() \
+ ); \
+ boost::chrono::stopclock_accumulator<>::scoped_stop BOOST_JOIN(_boost_chrono_stopclock_accumulator_stop_, __LINE__)(BOOST_JOIN(_boost_chrono_stopclock_accumulator_, __LINE__))
+
+void f1()
+{
+ //~ static stopclock_accumulator<> acc(
+ //~ std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] " + stopwatch_accumulator_formatter::default_format()
+ //~ );
+ //~ stopclock_accumulator<>::scoped_run _(acc);
+ BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_FCT;
+ //BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_FCT_REVERSE;
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
+ {
+ BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR;
+ //~ static stopclock_accumulator<> acc(
+ //~ std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] " + stopwatch_accumulator_formatter::default_format()
+ //~ );
+ //~ stopclock_accumulator<>::scoped_run _(acc);
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(200));
+ }
+
+}
+int main()
+{
+ BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_FCT;
+ //~ static stopclock_accumulator<> acc(
+ //~ std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] " + stopwatch_accumulator_formatter::default_format()
+ //~ );
+ //~ stopclock_accumulator<>::scoped_run _(acc);
+
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(10));
+ f1();
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
+ f1();
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(50));
+ f1();
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(200));
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopclock_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopclock_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,29 @@
+// stopclock_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+
+int f1(long j)
+{
+ scoped_stopclock<> _(BOOST_CURRENT_FUNCTION);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+ scoped_stopclock<> _(BOOST_CURRENT_FUNCTION);
+
+ f1(1000);
+ f1(2000);
+ f1(3000);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,35 @@
+// example/scoped_stopwatch_example.cpp ---------------------------------------------------//
+// Copyright 2009/2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+#include <cmath>
+#include "sleep_for.hpp"
+
+using namespace boost::chrono;
+
+long double res;
+void f1(long j)
+{
+ stopwatch_reporter<stopwatch<> > _(BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT);
+ for (long i =0; i< j; i+=1)
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j!=0) f1(j-1);
+ stopwatch_reporter<stopwatch<> >::scoped_suspend s(_);
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(10));
+
+}
+int main()
+{
+ stopwatch_reporter<stopwatch<> > _(BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT);
+
+ res=0;
+ for (long i =0; i< 3; ++i) {
+ f1(i*100);
+ }
+
+ std::cout<< res << std::endl;
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/sleep_for.hpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/sleep_for.hpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,26 @@
+// example/sleep_for.hpp -----------------------------------------------------------//
+
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#ifndef BOOST_CHRONO_SLEEP_FOR__HPP
+#define BOOST_CHRONO_SLEEP_FOR__HPP
+
+#include <boost/chrono/chrono.hpp>
+
+namespace boost {
+namespace this_thread {
+
+
+template <class Rep, class Period>
+void sleep_for(const boost::chrono::duration<Rep, Period>& d)
+{
+ boost::chrono::high_resolution_clock::time_point go = boost::chrono::high_resolution_clock::now() + d;
+ while (boost::chrono::high_resolution_clock::now() < go) {}
+}
+}
+}
+
+#endif //BOOST_CHRONO_SLEEP_FOR__HPP
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/specific_stopwatch_accumulator_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/specific_stopwatch_accumulator_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,97 @@
+// example/stopwatch_accumulator_example.cpp ---------------------------------------------------//
+// Copyright 2009/2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+#include <cmath>
+#include <boost/accumulators/statistics/variance.hpp>
+
+using namespace boost::chrono;
+using namespace boost::accumulators;
+
+ class my_stopwatch_accumulator_formatter {
+ public:
+ typedef std::string string_type;
+ typedef char char_type;
+ typedef std::ostream ostream_type;
+
+ static ostream_type & default_os() {return std::cout;}
+ static const char_type* default_format() {return "%c times, sum=%ss, mean=%as, variance=%vs\n";}
+ static int default_places() { return 3; }
+
+ template <class Stopwatch >
+ static void show_time( Stopwatch & stopwatch_, const char_type* format,
+ int places, ostream_type & os, boost::system::error_code & ec)
+ {
+ if (&ec != &BOOST_CHRONO_THROWS) ec.clear();
+ typedef typename Stopwatch::storage_type accumulator_t;
+ typedef typename Stopwatch::duration duration_t;
+ accumulator_t& acc = stopwatch_.get_storage();
+
+ boost::io::ios_flags_saver ifs( os );
+ os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+ boost::io::ios_precision_saver ips( os );
+ os.precision( places );
+
+ for ( ; *format; ++format ) {
+ if ( *format != '%' || !*(format+1) || !std::strchr("acsv", *(format+1)) ) {
+ os << *format;
+ } else {
+ ++format;
+ switch ( *format ) {
+ case 's':
+ os << boost::chrono::duration<double>(duration_t(sum(acc))).count();
+ break;
+ case 'a':
+ os << count(acc)>0?boost::chrono::duration<double>(duration_t(typename duration_t::rep(sum(acc)))).count()/count(acc):0;
+ break;
+ case 'c':
+ os << count(acc);
+ break;
+ case 'v':
+ os << boost::chrono::duration<double>(duration_t(typename duration_t::rep(variance(acc)))).count();
+ break;
+ default:
+ assert(0 && "my_stopwatch_accumulator_formatter internal logic error");
+ }
+ }
+ }
+ }
+ };
+
+
+typedef stopwatch_reporter<
+ stopwatch_accumulator<process_real_cpu_clock,
+ features<
+ tag::count,
+ tag::sum,
+ tag::mean,
+ tag::variance(lazy)
+ >
+ >
+ , my_stopwatch_accumulator_formatter
+ > my_stopwatch_accumulator_reporter;
+
+int f1(long j)
+{
+ //static my_stopwatch_accumulator_reporter acc(BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT);
+ static my_stopwatch_accumulator_reporter acc;
+ my_stopwatch_accumulator_reporter::scoped_run _(acc);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+ static my_stopwatch_accumulator_reporter acc;
+
+ f1(1000);
+ f1(2000);
+ f1(3000);
+ return 0;
+}
+
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/stopclock_accumulator_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/stopclock_accumulator_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,36 @@
+// stopwatch_accumulator_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopclock_accumulator.hpp>
+
+#include <cmath>
+#include "sleep_for.hpp"
+
+using namespace boost::chrono;
+
+template <typename Clock>
+int f1(long j)
+{
+ static stopclock_accumulator<Clock> acc(BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT);
+ typename stopclock_accumulator<Clock>::scoped_run _(acc);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(20));
+
+
+ return 0;
+}
+int main()
+{
+ static stopclock_accumulator<process_cpu_clock> acc(BOOST_STOPWATCHES_ACCUMULATOR_TIME_FUNCTION_FORMAT);
+ stopclock_accumulator<process_cpu_clock>::scoped_run _(acc);
+
+ f1<high_resolution_clock>(1000);
+ f1<high_resolution_clock>(2000);
+ f1<high_resolution_clock>(3000);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/stopclock_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/stopclock_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,29 @@
+// stopclock_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopclock.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+
+int f1(long j)
+{
+ stopclock<> _(BOOST_STOPWATCHES_TIME_FUNCTION_FORMAT);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+ stopclock<> _(BOOST_STOPWATCHES_TIME_FUNCTION_FORMAT);
+
+ f1(1000);
+ f1(2000);
+ f1(3000);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,30 @@
+// stopwatch_accumulator_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono for documentation.
+
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+#include <cmath>
+
+
+using namespace boost::chrono;
+
+int f1(long j)
+{
+ static stopwatch_reporter<stopwatch_accumulator<process_real_cpu_clock> > acc(BOOST_STOPWATCHES_ACCUMULATOR_FUNCTION_FORMAT);
+ stopwatch_reporter<stopwatch_accumulator<process_real_cpu_clock> >::scoped_run _(acc);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+
+ f1(1000);
+ f1(2000);
+ f1(3000);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,31 @@
+// example/stopwatch_example.cpp ---------------------------------------------------//
+// Copyright Beman Dawes 2006, 2008
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <iostream>
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+
+int f1(long j)
+{
+ stopwatch_reporter<stopwatch<> > _(BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+ stopwatch_reporter<stopwatch<> > _(BOOST_STOPWATCHES_STOPWATCH_FUNCTION_FORMAT);
+
+ f1(1000);
+ f1(2000);
+ f1(3000);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/suspendible_stopclock_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/suspendible_stopclock_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,38 @@
+// suspendible_stopclock_example.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/thread.hpp>
+#include <boost/chrono/chrono/stopclock.hpp>
+#include <boost/chrono/chrono/suspendible_clock.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+
+long double res;
+
+int f1(long j)
+{
+ stopclock<suspendible_clock<high_resolution_clock> > a(9);
+ //stopclock<high_resolution_clock> b(9);
+
+ for ( int i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j!=0) f1(j-1);
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+ return 0;
+}
+int main()
+{
+ //stopclock<> _(BOOST_CHRONO_TIME_FUNCTION_FORMAT);
+ //stopclock<> _(9);
+ stopclock<suspendible_clock<high_resolution_clock> > a(9);
+ //stopclock<high_resolution_clock> b(9);
+
+ for (int i =1; i<= 3; ++i)
+ f1(i*100);
+ std::cout<< res << std::endl;
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/t24_hours_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/t24_hours_example.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,34 @@
+// t24_hours_example.cpp ---------------------------------------------------//
+// Copyright Beman Dawes 2006, 2008
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopwatch.hpp>
+#include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/chrono/stopwatches/t24_hours_formatter.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+
+int f1(long j)
+{
+ stopwatch_reporter<stopwatch<process_real_cpu_clock>, t24_hours_formatter> hhmmss(BOOST_STOPWATCHES_24_HOURS_FUNCTION_FORMAT);
+ //stopwatch_reporter<stopwatch<process_real_cpu_clock>, t24_hours_formatter> hhmmss;
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+ stopwatch_reporter<stopwatch<process_real_cpu_clock>, t24_hours_formatter> hhmmss(BOOST_STOPWATCHES_24_HOURS_FUNCTION_FORMAT);
+
+ f1(1000);
+ f1(2000);
+ f1(3000);
+ return 0;
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/example/timex.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/timex.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,45 @@
+// timex: timed execution program ------------------------------------------//
+// Copyright Beman Dawes 2007
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopclock.hpp>
+#include <cstdlib>
+#include <string>
+#include <iostream>
+
+int main( int argc, char * argv[] )
+{
+ if ( argc == 1 )
+ {
+ std::cout << "invoke: timex [-v] command [args...]\n"
+ " command will be executed and timings displayed\n"
+ " -v option causes command and args to be displayed\n";
+ return 1;
+ }
+
+ std::string s;
+
+ bool verbose = false;
+ if ( argc > 1 && *argv[1] == '-' && *(argv[1]+1) == 'v' )
+ {
+ verbose = true;
+ ++argv;
+ --argc;
+ }
+
+ for ( int i = 1; i < argc; ++i )
+ {
+ if ( i > 1 ) s += ' ';
+ s += argv[i];
+ }
+
+ if ( verbose )
+ { std::cout << "command: \"" << s.c_str() << "\"\n"; }
+
+ boost::chrono::stopclock<> t;
+
+ return std::system( s.c_str() );
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/perf/stopclock_perf.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/perf/stopclock_perf.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,793 @@
+// stopclock_perf.cpp ---------------------------------------------------//
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/thread.hpp>
+#include <boost/chrono/stopwatches/stopclock.hpp>
+#include <boost/chrono/thread_clock.hpp>
+
+#include <boost/chrono/stopwatches/suspendible_clock.hpp>
+#include <boost/chrono/stopwatches/stopclock_accumulator.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+double res;
+
+
+namespace rep_none {
+ std::size_t count[11];
+
+ template <typename Clock>
+ void f10(long v);
+
+ template <typename Clock>
+ void f1(long v) {
+ std::cout<< ">>> f1 " << v << "\n";
+ ++count[1];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+ f10<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f2(long v) {
+ std::cout<< ">>> f2 " << v << "\n";
+ ++count[2];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=2) return;
+
+ f1<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f3(long v) {
+ std::cout<< ">>> f3 " << v << "\n";
+ ++count[3];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=3) return;
+
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f4(long v) {
+ std::cout<< ">>> f4 " << v << "\n";
+ ++count[4];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=4) return;
+
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f5(long v) {
+ std::cout<< ">>> f5 " << v << "\n";
+ ++count[5];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=5) return;
+
+ if (v%4==0) {f4<Clock>(v-1); return;}
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f6(long v) {
+ std::cout<< ">>> f6 " << v << "\n";
+ ++count[6];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=6) return;
+
+ if (v%5==0) {f5<Clock>(v-1); return;}
+ if (v%4==0) {f4<Clock>(v-1); return;}
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f7(long v) {
+ std::cout<< ">>> f7 " << v << "\n";
+ ++count[7];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=7) return;
+
+ if (v%6==0) {f6<Clock>(v-1); return;}
+ if (v%5==0) {f5<Clock>(v-1); return;}
+ if (v%4==0) {f4<Clock>(v-1); return;}
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f8(long v) {
+ std::cout<< ">>> f8 " << v << "\n";
+ ++count[8];
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=8) return;
+
+ if (v%7==0) {f7<Clock>(v-1); return;}
+ if (v%6==0) {f6<Clock>(v-1); return;}
+ if (v%5==0) {f5<Clock>(v-1); return;}
+ if (v%4==0) {f4<Clock>(v-1); return;}
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f9(long v) {
+ std::cout<< ">>> f9 " << v << "\n";
+ ++count[9];
+ //std::cout<< ">>> COUNT NONE " << " " << rep_none::count[9] << std::endl;
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=9) return;
+
+ if (v%8==0) {f8<Clock>(v-1); return;}
+ if (v%7==0) {f7<Clock>(v-1); return;}
+ if (v%6==0) {f6<Clock>(v-1); return;}
+ if (v%5==0) {f5<Clock>(v-1); return;}
+ if (v%4==0) {f4<Clock>(v-1); return;}
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f10(long v) {
+ std::cout<< ">>> f10 " << v << "\n";
+ ++count[10];
+ //std::cout<< ">>> COUNT NONE 10 " << " " << rep_none::count[10] << std::endl;
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+
+ if ((v%9)==0) {f9<Clock>(v-1); return;}
+ if ((v%8)==0) {f8<Clock>(v-1); return;}
+ if ((v%7)==0) {f7<Clock>(v-1); return;}
+ if ((v%6)==0) {f6<Clock>(v-1); return;}
+ if ((v%5)==0) {f5<Clock>(v-1); return;}
+ if ((v%4)==0) {f4<Clock>(v-1); return;}
+ if ((v%3)==0) {f3<Clock>(v-1); return;}
+ if ((v%2)==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f(long j)
+ {
+ ++count[0];
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j>1) {
+ f<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+ }
+}
+
+
+namespace rep_basic {
+ std::size_t count[11];
+
+ template <typename Clock>
+ void f10(long v);
+
+ template <typename Clock>
+ void f1(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+ f10<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f2(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=2) return;
+
+ f1<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f3(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=3) return;
+
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f4(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=4) return;
+
+ if (v%3==0) {f3<Clock>(v-1); return;}
+ if (v%2==0) {f2<Clock>(v-1); return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f5(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=5) return;
+
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f6(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=6) return;
+
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f7(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=7) return;
+
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f8(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=8) return;
+
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f9(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=9) return;
+
+ if (v%8==0) {f8<Clock>(v-1);return;}
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f10(long v) {
+ stopclock<Clock> b(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+
+ if (v%9==0) {f9<Clock>(v-1);return;}
+ if (v%8==0) {f8<Clock>(v-1);return;}
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f(long j)
+ {
+ stopclock<Clock> b(9);
+
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j>1) {
+ //std::cout << "f1("<<j-1<<")\n";
+ f<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+ }
+}
+
+namespace rep_suspendible {
+ std::size_t count[11];
+
+ template <typename Clock>
+ void f10(long v);
+
+ template <typename Clock>
+ void f1(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=1) return;
+ f10<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f2(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=2) return;
+
+ f1<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f3(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=3) return;
+
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f4(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=4) return;
+
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f5(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=5) return;
+
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f6(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=6) return;
+
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f7(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=7) return;
+
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f8(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=8) return;
+
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f9(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=9) return;
+
+ if (v%8==0) {f8<Clock>(v-1);return;}
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f10(long v) {
+ stopclock<suspendible_clock<Clock> > a(9);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+
+ if (v%9==0) {f9<Clock>(v-1);return;}
+ if (v%8==0) {f8<Clock>(v-1);return;}
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f(long j)
+ {
+ stopclock<suspendible_clock<Clock> > a(9);
+
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j>1) {
+ //std::cout << "f1("<<j-1<<")\n";
+ f<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+ }
+}
+
+namespace rep_accu {
+ std::size_t count[11];
+
+ template <typename Clock>
+ void f10(long v);
+
+ template <typename Clock>
+ void f1(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+ f10<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f2(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=2) return;
+
+ f1<Clock>(v-1);
+ }
+
+ template <typename Clock>
+ void f3(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=3) return;
+
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f4(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=4) return;
+
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f5(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=5) return;
+
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f6(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=6) return;
+
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f7(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=7) return;
+
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f8(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=8) return;
+
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f9(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=9) return;
+
+ if (v%8==0) {f8<Clock>(v-1);return;}
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f10(long v) {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+ // burn some time
+ for ( long i = 0; i < v; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (v<=10) return;
+
+ if (v%9==0) {f9<Clock>(v-1);return;}
+ if (v%8==0) {f8<Clock>(v-1);return;}
+ if (v%7==0) {f7<Clock>(v-1);return;}
+ if (v%6==0) {f6<Clock>(v-1);return;}
+ if (v%5==0) {f5<Clock>(v-1);return;}
+ if (v%4==0) {f4<Clock>(v-1);return;}
+ if (v%3==0) {f3<Clock>(v-1);return;}
+ if (v%2==0) {f2<Clock>(v-1);return;}
+ f1<Clock>(v-1);
+ }
+ template <typename Clock>
+ void f(long j)
+ {
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j>1) {
+ //std::cout << "f1("<<j-1<<")\n";
+ f<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+ }
+}
+
+template <typename Clock, long SIZE>
+void test_clock_size()
+{
+ long K =1;
+ std::cout << ">>> test_clock_size " << SIZE << std::endl;
+ {
+ rep_none::count[0]=0;
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> REC NONE ")+ stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_none::f<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ std::cout<< ">>> COUNT REC NONE " << SIZE << " " << rep_none::count[0] << std::endl;
+
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> REC BASIC ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_basic::f<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<suspendible_clock<Clock> > a(9, std::string(">>> REC SUSPEND ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_suspendible::f<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> REC ACCU ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_accu::f<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ for (int i=1;i<=10;i++) rep_none::count[i]=0;
+ stopclock<Clock> b(9, std::string(">>> NON_REC NONE ")+ stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_none::f10<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ std::size_t c=0;
+ for (int i=1;i<=10;i++)
+ c+= rep_none::count[i];
+ std::cout<< ">>> COUNT NON_REC NONE " << SIZE << " " << c << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> NON_REC BASIC ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_basic::f10<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<suspendible_clock<Clock> > a(9, std::string(">>> NON_REC SUSPEND ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_suspendible::f10<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> NON_REC ACCU ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= K; ++i)
+ rep_accu::f10<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+#if 0
+#endif
+}
+
+template <typename Clock>
+void test_clock()
+{
+ //test_clock_size<Clock, 3200>();
+ //test_clock_size<Clock, 1600>();
+ //test_clock_size<Clock, 800>();
+ //test_clock_size<Clock, 400>();
+ //test_clock_size<Clock, 200>();
+ test_clock_size<Clock, 1050>();
+ test_clock_size<Clock, 1040>();
+ test_clock_size<Clock, 1030>();
+ test_clock_size<Clock, 1020>();
+ test_clock_size<Clock, 1010>();
+ test_clock_size<Clock, 1000>();
+ test_clock_size<Clock, 100>();
+
+
+
+
+
+
+}
+
+
+int main() {
+#ifdef BOOST_CHRONO_HAS_THREAD_CLOCK
+ std::cout << ">>> main thread_clock" << std::endl;
+ test_clock<thread_clock>();
+#endif
+ std::cout << ">>> main high_resolution_clock" << std::endl;
+ test_clock<high_resolution_clock>();
+#ifdef BOOST_CHRONO_HAS_THREAD_CLOCK
+ std::cout << ">>> main thread_clock" << std::endl;
+ test_clock<thread_clock>();
+#endif
+
+ return 0;
+
+}
Added: sandbox/stopwatches/libs/chrono/stopwatches/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/test/Jamfile.v2 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,99 @@
+# Boost Stopwatches Library test Jamfile
+
+# Copyright Beman Dawes 2003, 2006, 2008
+# Copyright Vicente J. Botet Escriba 2009-2010
+
+
+# Distributed under the Boost Software License, Version 1.0.
+# See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt
+
+# See library home page at http://www.boost.org/libs/stopwatches
+
+# uncomment one if the above lines if you build outside the Boost release
+#local BOOST = /boost_1_41_0 ;
+#local BOOST = c:/cygwin/boost_1_41_0 ;
+
+if ! $(BOOST)
+{
+ BOOST = [ modules.peek : BOOST ] ;
+}
+
+project
+ : requirements
+ <os>LINUX:<threading>multi
+ <library>/boost/chrono//boost_chrono
+ <library>/boost/system//boost_system
+ #<library>/boost/thread//boost_thread/<link>shared
+ # uncomment the line above if you build outside the Boost release
+ <include>$(BOOST)
+ # uncomment the line above if you build outside the Boost release
+ <include>../../../..
+ <toolset>msvc:<asynch-exceptions>on
+ <define>BOOST_ENABLE_WARNINGS
+ <define>BOOST_CHRONO_EXTENSIONS
+ <warnings>all
+ <toolset>gcc:<cxxflags>-Wextra
+ <toolset>gcc:<cxxflags>-pedantic
+ <toolset>gcc:<cxxflags>-Wno-long-long
+ <toolset>darwin:<cxxflags>-Wextra
+ <toolset>darwin:<cxxflags>-pedantic
+ <toolset>darwin:<cxxflags>-Wno-long-long
+ #<toolset>pathscale:<cxxflags>-Wextra
+ <toolset>pathscale:<cxxflags>-Wno-long-long
+ <toolset>pathscale:<cxxflags>-pedantic
+ <toolset>clang:<cxxflags>-Wextra
+ <toolset>clang:<cxxflags>-pedantic
+ <toolset>clang:<cxxflags>-Wno-long-long
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
+ <toolset>msvc:<cxxflags>/wd4127
+ ;
+
+ test-suite "minmax"
+ :
+ [ compile test_minmax.cpp ]
+ ;
+
+ test-suite "other_clocks"
+ :
+ #[ run test_suspendible_clock.cpp : : : <library>/boost/thread//boost_thread <link>static ]
+ #[ run test_suspendible_clock.cpp : : : <library>/boost/thread//boost_thread : test_suspendible_clock_dll ]
+ ;
+
+ test-suite "stopwatch"
+ :
+ [ run stopclock_constructor_overload_test.cpp : : : <link>static ]
+ [ run stopclock_constructor_overload_test.cpp : : : : stopclock_constructor_overload_test_dll ]
+ [ run wstopclock_constructor_overload_test.cpp : : : <link>static ]
+ [ run wstopclock_constructor_overload_test.cpp : : : : wstopclock_constructor_overload_test_dll ]
+ [ run ../example/scoped_stopclock_example.cpp : : : <link>static ]
+ [ run ../example/scoped_stopclock_example.cpp : : : : function_stopclock_example_dll ]
+ [ run ../example/stopwatch_example.cpp : : : <link>static ]
+ [ run ../example/stopwatch_example.cpp : : : : stopwatch_example_dll ]
+ [ run ../example/scoped_stopwatch_example.cpp : : : <link>static ]
+ [ run ../example/scoped_stopwatch_example.cpp : : : : scoped_stopwatch_example_dll ]
+ [ run ../example/stopwatch_accumulator_example.cpp : : : <link>static ]
+ [ run ../example/stopwatch_accumulator_example.cpp : : : : stopwatch_accumulator_example_dll ]
+ [ run ../example/specific_stopwatch_accumulator_example.cpp : : : <link>static ]
+ [ run ../example/specific_stopwatch_accumulator_example.cpp : : : : specific_stopwatch_accumulator_example_dll ]
+ [ run ../example/stopclock_example.cpp : : : <link>static ]
+ [ run ../example/stopclock_example.cpp : : : : stopclock_example_dll ]
+ [ run ../example/stopclock_accumulator_example.cpp : : : <link>static ]
+ [ run ../example/stopclock_accumulator_example.cpp : : : : stopclock_accumulator_example_dll ]
+ [ run ../example/nested_stopclock_accumulator_example.cpp : : : <link>static ]
+ [ run ../example/nested_stopclock_accumulator_example.cpp : : : : nested_stopclock_accumulator_example_dll ]
+ [ run ../example/loop_stopclock_accumulator_example.cpp : : : <link>static ]
+ [ run ../example/loop_stopclock_accumulator_example.cpp : : : : loop_stopclock_accumulator_example_dll ]
+ [ run ../example/t24_hours_example.cpp : : : <link>static ]
+ [ run ../example/t24_hours_example.cpp : : : : t24_hours_example_dll ]
+ [ link ../example/timex.cpp : <link>static ]
+ [ link ../example/timex.cpp : : timex_dll ]
+ ;
+
+ test-suite "perf"
+ :
+ #[ run ../example/suspendible_stopclock_example.cpp : : : <library>/boost/thread//boost_thread <link>static ]
+ #[ run ../example/suspendible_stopclock_example.cpp : : : <library>/boost/thread//boost_thread : suspendible_stopclock_example_dll ]
+ #[ run ../perf/stopclock_perf.cpp : : : <library>/boost/thread//boost_thread <link>static ]
+ #[ run ../perf/stopclock_perf.cpp : : : <library>/boost/thread//boost_thread : stopclock_perf_dll ]
+ ;
Added: sandbox/stopwatches/libs/chrono/stopwatches/test/stopclock_constructor_overload_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/test/stopclock_constructor_overload_test.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,73 @@
+// tes/stopclock_constructor_overload_test.cpp -----------------------------------------------------//
+// Copyright Beman Dawes 2006, 2008
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono for documentation.
+
+#include <boost/chrono/stopwatches/stopclock.hpp>
+#include <cstdlib> // for atol()
+#include <iostream>
+#include <sstream>
+#include <locale>
+#include <ctime>
+#include <cmath> // for sqrt(), used to burn time
+
+using boost::chrono::stopclock;
+using boost::chrono::time_formatter;
+using boost::system::error_code;
+
+#include <boost/detail/lightweight_test.hpp>
+
+namespace
+{
+
+ void stopclock_constructor_overload_test()
+ {
+ // exercise each supported combination of constructor arguments
+
+ std::ostream & os = std::cout;
+ const int pl = 9;
+ boost::system::error_code ec;
+
+ stopclock<> t1;
+ stopclock<> t2( os );
+ stopclock<> t3( ec );
+ stopclock<> t4( os, ec );
+ stopclock<> t5( pl );
+ stopclock<> t6( os, pl );
+ stopclock<> t7( pl, ec );
+ stopclock<> t8( os, pl, ec );
+ stopclock<> t9( "t9, default places, r %r, c %c, p %p, u %u, s %s\n" );
+ stopclock<> t10( os, "t10, default places, r %r, c %c, p %p, u %u, s %s\n" );
+ stopclock<> t11( "t11, default places, r %r, c %c, p %p, u %u, s %s\n", ec );
+ stopclock<> t12( os, "t12, default places, r %r, c %c, p %p, u %u, s %s\n", ec );
+ stopclock<> t13( pl, "t13, explicitly code places, r %r, c %c, p %p, u %u, s %s\n" );
+ stopclock<> t14( "t14, explicitly code places, r %r, c %c, p %p, u %u, s %s\n", pl );
+ stopclock<> t15( os, pl, "t15, explicitly code places, r %r, c %c, p %p, u %u, s %s\n" );
+ stopclock<> t16( os, "t16, explicitly code places, r %r, c %c, p %p, u %u, s %s\n", pl );
+ stopclock<> t17( pl, "t17, explicitly code places, r %r, c %c, p %p, u %u, s %s\n", ec );
+ stopclock<> t18( "t18, explicitly code places, r %r, c %c, p %p, u %u, s %s\n", pl, ec );
+ stopclock<> t19( os, pl, "t19, explicitly code places, r %r, c %c, p %p, u %u, s %s\n", ec );
+ stopclock<> t20( os, "t20, explicitly code places, r %r, c %c, p %p, u %u, s %s\n", pl, ec );
+
+ std::cout << "Burn some time so run_timers have something to report...";
+ boost::chrono::stopwatch<boost::chrono::high_resolution_clock> t;
+ while ( t.elapsed() < boost::chrono::seconds(1) ) {}
+ std::cout << "\n";
+ std::cout << time_formatter::default_places() << " default places\n";
+ std::cout << pl << " explicitly coded places\n";
+ }
+
+}
+
+int main( )
+{
+ //~ std::locale loc( "" ); // test with appropriate locale
+ //~ std::cout.imbue( loc );
+
+ stopclock_constructor_overload_test();
+
+ return boost::report_errors();
+}
+
Added: sandbox/stopwatches/libs/chrono/stopwatches/test/test_minmax.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/test/test_minmax.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,18 @@
+// test_minmax.cpp ----------------------------------------------------------//
+// Copyright 2011 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#if !defined(__GNUC__)
+
+#define min(A,B) ((A)<(B)?(A):(B))
+#define max(A,B) ((A)>(B)?(A):(B))
+
+#include <boost/chrono/stopwatches/stopwatches.hpp>
+
+ int main()
+ {
+ boost::chrono::stopclock<> _;
+ }
+
+#endif
Added: sandbox/stopwatches/libs/chrono/stopwatches/test/wstopclock_constructor_overload_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/stopwatches/libs/chrono/stopwatches/test/wstopclock_constructor_overload_test.cpp 2011-09-11 08:43:58 EDT (Sun, 11 Sep 2011)
@@ -0,0 +1,135 @@
+// test/wstopclock_constructor_overload_test.cpp -----------------------------------------------------//
+// Copyright Beman Dawes 2006, 2008
+// Copyright 2009-2011 Vicente J. Botet Escriba
+// Copyright 2010 Tan Zhi(Tom)
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+// See http://www.boost.org/libs/chrono/stopwatches for documentation.
+
+#include <boost/chrono/stopwatches/stopclock.hpp>
+#include <boost/chrono/process_cpu_clocks.hpp>
+#include <boost/chrono/stopwatches/stopwatch.hpp>
+
+#include <cstdlib> // for atol()
+#include <iostream>
+#include <sstream>
+#include <locale>
+#include <ctime>
+#include <cmath> // for sqrt(), used to burn time
+
+#include <string>
+
+using boost::chrono::stopwatch;
+using boost::chrono::stopclock;
+using boost::chrono::process_cpu_clock;
+using boost::chrono::wtime_formatter;
+using boost::chrono::time_formatter;
+using boost::system::error_code;
+using boost::chrono::detail::adaptive_string;
+
+#include <boost/detail/lightweight_test.hpp>
+
+
+namespace util
+{
+
+ /**
+ * this class return std::cout or std::wcout according to
+ * the context(e.g. type on the left side of '=' operator)
+ */
+ struct console
+ {
+
+ template <
+ typename Traits
+ >
+ operator std::basic_ostream<char,Traits>&() const
+ {
+ return std::cout;
+ }
+#ifndef BOOST_NO_STD_WSTRING
+ template <
+ typename Traits
+ >
+ operator std::basic_ostream<wchar_t,Traits>&() const
+ {
+ return std::wcout;
+ }
+#endif
+ };
+
+} // namespace util
+
+
+ // overload adaptive_string for streaming operation with cout/wcout
+ template<class charT>
+ std::basic_ostream<charT>& operator << (std::basic_ostream<charT>& os, const boost::chrono::detail::adaptive_string& s)
+ {
+ os << std::basic_string<charT>(s);
+ return os;
+ }
+
+
+namespace
+{
+ using namespace util;
+
+ template<class stopclock_type>
+ void stopclock_constructor_overload_test()
+ {
+ // exercise each supported combination of constructor arguments
+
+ typename stopclock_type::ostream_type& os = console();
+ const int pl = 9;
+ boost::system::error_code ec;
+
+ stopclock_type t1;
+ stopclock_type t2( os );
+ stopclock_type t3( ec );
+ stopclock_type t4( os, ec );
+ stopclock_type t5( pl );
+ stopclock_type t6( os, pl );
+ stopclock_type t7( pl, ec );
+ stopclock_type t8( os, pl, ec );
+ stopclock_type t9( adaptive_string("t9, default places, r %r, c %c, p %p, u %u, s %s\n") );
+ stopclock_type t10( os, adaptive_string("t10, default places, r %r, c %c, p %p, u %u, s %s\n") );
+ stopclock_type t11( adaptive_string("t11, default places, r %r, c %c, p %p, u %u, s %s\n"), ec );
+ stopclock_type t12( os, adaptive_string("t12, default places, r %r, c %c, p %p, u %u, s %s\n"), ec );
+ stopclock_type t13( pl, adaptive_string("t13, explicitly code places, r %r, c %c, p %p, u %u, s %s\n") );
+ stopclock_type t14( adaptive_string("t14, explicitly code places, r %r, c %c, p %p, u %u, s %s\n"), pl );
+ stopclock_type t15( os, pl, adaptive_string("t15, explicitly code places, r %r, c %c, p %p, u %u, s %s\n") );
+ stopclock_type t16( os, adaptive_string("t16, explicitly code places, r %r, c %c, p %p, u %u, s %s\n"), pl );
+ stopclock_type t17( pl, adaptive_string("t17, explicitly code places, r %r, c %c, p %p, u %u, s %s\n"), ec );
+ stopclock_type t18( adaptive_string("t18, explicitly code places, r %r, c %c, p %p, u %u, s %s\n"), pl, ec );
+ stopclock_type t19( os, pl, adaptive_string("t19, explicitly code places, r %r, c %c, p %p, u %u, s %s\n"), ec );
+ stopclock_type t20( os, adaptive_string("t20, explicitly code places, r %r, c %c, p %p, u %u, s %s\n"), pl, ec );
+
+ std::cout << adaptive_string("Burn some time so run_timers have something to report...");
+
+ boost::chrono::stopwatch<boost::chrono::high_resolution_clock> t;
+ while ( t.elapsed() < boost::chrono::seconds(1) ) {}
+
+ std::cout << adaptive_string("\n");
+ std::cout << time_formatter::default_places() << adaptive_string(" default places\n");
+ std::cout << pl << adaptive_string(" explicitly coded places\n");
+ }
+
+ typedef stopclock <> stopclock_t;
+ typedef stopclock <
+ process_cpu_clock,
+ boost::chrono::wtime_formatter
+ > wstopclock_t;
+}
+
+int main( )
+{
+ //~ std::locale loc( "" ); // test with appropriate locale
+ //~ std::cout.imbue( loc );
+
+ stopclock_constructor_overload_test<stopclock_t>(); // test for char
+#ifndef BOOST_NO_STD_WSTRING
+ stopclock_constructor_overload_test<wstopclock_t>(); // test for wchar_t
+#endif
+ return boost::report_errors();
+}
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk