|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58480 - in sandbox/chrono/libs/chrono: build doc doc/html doc/html/boost_chrono doc/html/boost_chrono/appendices doc/html/boost_chrono/examples doc/html/boost_chrono/overview doc/html/boost_chrono/reference doc/html/boost_chrono/users_guide example src src/mac src/posix src/win test
From: vicente.botet_at_[hidden]
Date: 2009-12-21 11:56:09
Author: viboes
Date: 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
New Revision: 58480
URL: http://svn.boost.org/trac/boost/changeset/58480
Log:
Boost.Chrono: Version 0.3.0, New stopwatch feature
* independent cpu clocks for real, user, system process CPU time.
* new Stopwatch concept measuring elapsed time between different points in time associated to the operations start, stop, suspend and resume.
* stopwatch is a model Stopwatch measuring the elapsed time between the start and the stop operations.
* stopwatch_accumulator is a model Stopwatch allowing to accumulate several time samples and give the average, ...
* scoped helper classes allowing to pairwise start/stop operations, suspend/resume and resume/suspend a Stopwatch.
* new Stopwatch Formatter concept
* stopwatch_reporter is a generic class reporting elapsed time for the Stopwatch concept.
* process_times.hpp has been deprecated, see process_clocks.hpp, process_stopwhatches.hpp and process_stopwhatches_reporter.hpp.
* timer.hpp has been deprecated, see stopwatch.
Added:
sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/process_stopwatches_reporter_example2_cpp.html (contents, props changed)
sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/process_stopwatches_reporter_example_cpp.html (contents, props changed)
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html (contents, props changed)
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated_headers.html (contents, props changed)
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/process_cpu_related.html (contents, props changed)
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html (contents, props changed)
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html (contents, props changed)
sandbox/chrono/libs/chrono/example/stopwatch_example.cpp (contents, props changed)
Text files modified:
sandbox/chrono/libs/chrono/build/Jamfile.v2 | 2
sandbox/chrono/libs/chrono/doc/chrono.qbk | 915 +++++++++++++++++++++++++++++++++++----
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html | 2
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html | 56 ++
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html | 19
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html | 8
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html | 4
sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples.html | 11
sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html | 6
sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/time_command.html | 8
sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html | 56 +
sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html | 109 +++-
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference.html | 90 +--
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html | 22
sandbox/chrono/libs/chrono/doc/html/index.html | 20
sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest | 14
sandbox/chrono/libs/chrono/src/mac/process_clock.cpp | 3
sandbox/chrono/libs/chrono/src/posix/process_clock.cpp | 2
sandbox/chrono/libs/chrono/src/process_clock.cpp | 11
sandbox/chrono/libs/chrono/src/run_timer.cpp | 31
sandbox/chrono/libs/chrono/src/run_timer_static.cpp | 3
sandbox/chrono/libs/chrono/src/win/process_clock.cpp | 3
sandbox/chrono/libs/chrono/test/Jamfile.v2 | 6
23 files changed, 1131 insertions(+), 270 deletions(-)
Modified: sandbox/chrono/libs/chrono/build/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/build/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/build/Jamfile.v2 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -41,7 +41,7 @@
#<link>static:<define>BOOST_CHRONO_STATIC_LINK=1
;
-SOURCES = chrono process_clock run_timer run_timer_static ;
+SOURCES = chrono process_clock run_timer run_timer_static cpu_clocks ;
lib boost_chrono
: $(SOURCES).cpp
Modified: sandbox/chrono/libs/chrono/doc/chrono.qbk
==============================================================================
--- sandbox/chrono/libs/chrono/doc/chrono.qbk (original)
+++ sandbox/chrono/libs/chrono/doc/chrono.qbk 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -56,15 +56,21 @@
* `monotonic_clock`
* `high_resolution_clock`
-* Class template timer, with typedefs:
- * `system_timer`
- * `monotonic_timer`
- * `high_resolution_timer`
-
-* Process clocks and timers:
- * `process_clock`, capturing real, user-CPU, and system-CPU times.
- * `process_timer`, capturing elapsed real, user-CPU, and system-CPU times.
- * `run_timer`, convenient reporting of process_timer results.
+* Process clocks:
+ * `process_real_CPU_clocks`, capturing real-CPU times.
+ * `process_user_CPU_clocks`, capturing user-CPU times.
+ * `process_system_CPU_clocks`, capturing system-CPU times.
+ * `process_clocks`, tuple-like class capturing at once real, user-CPU, and system-CPU times.
+
+* Stopwatches:
+ * `stopwatch`, capturing elapsed Clock times.
+ * `stopwatch_accumulator`, capturing cummulated elapsed Clock times.
+ * scoped helper classes allowing to pairwise start/stop operations, suspend/resume and resume/suspend a Stopwatch.
+ * `process_stopwatches`, capturing elapsed real, user-CPU, and system-CPU times.
+
+* Stopwatch reporters:
+ * `stopwatch_reporter`, convenient reporting of models of Stopwatch results.
+ * `process_stopwatches_reporter`, convenient reporting of process_stopwatches results.
[/====================================]
[heading How to Use This Documentation]
@@ -395,15 +401,51 @@
[endsect]
-[section Timers]
+[section Stopwatches]
-Knowing how long a program takes to execute is useful in both test and production environments. It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests.
+Knowing how long a program, a function or a specific block takes to execute is useful in both test and production environments. __Boost_Chrono__ introduces the Stopwatch concept which captures the mechanism to measure the elapsed time. `stopwatch<>` is the basic model of Stopwatch
+
+It is also interesting to have an statisitical view of these times. `stopwatch_accumulator<>` associates an accumulator with a stopwatch, so we are able to retrieve any statistical feature Boost.Accumulator provides. the Aprovides stopwatches utilities useful when the automatic reporting of `stopwatch_reporter` isn't desired.
+
+The highest level use case of measuring the elapsed time is to report these times 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) {
+ static stopwatch_accumulator<>::reporter sw;
+ stopwatch_accumulator<>::reporter::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
+
+ Count=3 times Sum=0.034s Min=0.006s Max=0.017s Mean=0.011s
+
+It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests. `process_real_CPU_clock`, `process_user_CPU_clock`, `process_system_CPU_clock` and `process_clocks` provides a thin wrappers around the operating system's process timer API. The first three captre the a specific time unitarily, the last captures the three times at once. For POSIX-like systems, that's the times() function, while for Windows, it's the GetProcessTimes() function.
-The Boost Chrono Library's process times components provide that information:
+As `process_clocks` do not conform to the Stopwatch concept, __Boost_Chrono__ provides the equivalent of `stopwatch<process_clocks>` and `stopwatch_reporter<process_clocks>` with the classes `process_stopwatches` and `process_stopwatches_reporter`
-* At the highest level, class `run_timer` provides a complete run time reporting package that can be invoked in a single line of code.
-* At a middle level, class `process_timer` provides a process timer useful when the automatic reporting of `run_timer` isn't desired.
-* At the lowest level, `process_clock` provides a thin wrapper around the operating system's process timer API. For POSIX-like systems, that's the times() function, while for Windows, it's the GetProcessTimes() function.
+ using namespace boost::chrono;
+ int main()
+ {
+ process_stopwatches_reporter _;
+ // ...
+ }
+
+Will produce the following output
+
+ real 0.034s, cpu 0.031s (93.0%), user 0.031s, system 0.000s
[endsect]
@@ -553,16 +595,16 @@
// add this in the scope you want to time,
// at the point you want the timer to start.
- boost::chrono::run_timer rt;
+ boost::chrono::process_stopwatches_reporter rt;
-Here is a complete program (run_timer_example.cpp):
+Here is a complete program (process_stopwatches_reporter_example.cpp):
#include <boost/chrono/process_times.hpp>
#include <cmath>
int main()
{
- boost::chrono::run_timer t;
+ boost::chrono::process_stopwatches_reporter t;
for ( long i = 0; i < 10000000; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -621,6 +663,7 @@
[section:reference Reference ]
[/=================]
+[section:cpp0x Included on the C++0x recommendation]
[/===================================================================]
[section:common_type_hpp Header `<boost/type_traits/common_type.hpp>`]
@@ -1777,18 +1820,24 @@
[endsect]
-[/ comment
-[/==================================================]
-[section:cpu_clocks_hpp Header `<boost/chrono/cpu_clocks.hpp>`]
-[/==================================================]
+[endsect]
+
+[section Process CPU related]
+
+[/==================================================================]
+[section:process_clocks_hpp Header `<boost/chrono/process_clocks.hpp>`]
+[/==================================================================]
Knowing how long a program takes to execute is useful in both test and production environments. It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests.
- namespace boost { namespace chrono {
+ namespace boost { namespace chrono {
+
class process_real_cpu_clock;
class process_user_cpu_clock;
class process_system_cpu_clock;
- }}
+ class process_clocks;
+
+ } }
[section Class `process_real_cpu_clock`]
@@ -1849,162 +1898,794 @@
[endsect]
+[section Class `process_clocks`]
+
+`process_clocks` can be considered as a `tuple<process_real_cpu_clock, process_user_cpu_clock, process_system_cpu_clock>`. Obviously it doesn't satisfy the Clock Requirements.
+
+`process_clocks` provides a thin wrapper around the operating system's process timer API. For POSIX-like systems, that's the times() function, while for Windows, it's the GetProcessTimes() function.
+
+The process relative real, user and system current time can be obtained at once by calling `process_clocks::now()`.
+
+
+ class process_clocks {
+ public:
+ typedef nanoseconds duration;
+ typedef duration::rep rep;
+ typedef duration::period period;
+ typedef chrono::time_point<process_clocks> time_point;
+ static const bool is_monotonic = true;
+
+ struct durations;
+ static void now( process_clocks::durations & times,
+ system::error_code & ec = system::throws );
+ };
+
+[section Class `durations`]
+
+ struct durations {
+ process_clocks::duration real; // real (i.e wall clock) time
+ process_clocks::duration user; // user cpu time
+ process_clocks::duration system; // system cpu time
+ };
+
+[endsect]
+
+[endsect]
+
+
+[endsect]
+
+
+[endsect]
+
+[/==================================================]
+[section Stopwatches]
+[/==================================================]
+[section `Stopwatch` Requirements]
+
+A Stopwatch measure the amount of time elapsed from a particular time when activated to when it is deactivated, or the accumulation of them.
+
+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 the CLock concept.] [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.start()`] [`S::time_point`] [starts a Stopwatch.]]
+ [[`s.restart()`] [`std::paire<S::duration,S::time_point>`] [restarts a Stopwatch.]]
+ [[`s.stop()`] [`S::duration`] [stops a Stopwatch.]]
+ [[`s.resume()`] [`S::time_point`] [starts a Stopwatch.]]
+ [[`s.suspend()`] [`S::duration`] [stops a Stopwatch.]]
+ [[`s.elapsed()`] [`S::duration`] [the elapsed time while the Stopwatch was running.]]
+]
[endsect]
-comment ]
[/==================================================]
-[section:timer_hpp Header `<boost/chrono/timer.hpp>`]
+[section:stopwatch_hpp Header `<boost/chrono/stopwatch.hpp>`]
[/==================================================]
namespace boost { namespace chrono {
- template <class Clock> class timer;
- typedef <see above> system_timer;
+ struct dont_start_t;
+ static const dont_start_t dont_start;
+
+ template <class Clock=high_resolution_clock> class stopwatch;
+
+ typedef <see above> system_stopwatch;
#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- typedef <see above> monotonic_timer;
+ typedef <see above> monotonic_stopwatch;
#endif
- typedef <see above> high_resolution_timer;
+ typedef <see above> high_resolution_stopwatch;
+ typedef <see above> process_real_cpu_stopwatch;
+ typedef <see above> process_user_cpu_stopwatch;
+ typedef <see above> process_system_cpu_stopwatch;
}}
-[/
- typedef <see above> process_real_cpu_timer;
- typedef <see above> process_user_cpu_timer;
- typedef <see above> process_system_cpu_timer;
-]
-[section Template Class `timer<>`]
+[section Template Class `stopwatch<>`]
+
+`stopwatch<>` is a model of a `Stopwatch`.
Knowing how long a part of a program takes to execute is useful in both test and production environments.
-A `timer` 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.
+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 coudl varies a great deal from one clock to another.
- template <class Clock> class timer {
+ template <class Clock> class stopwatch {
public:
typedef Clock clock;
typedef typename Clock::duration duration;
typedef typename Clock::time_point time_point;
- explicit timer( system::error_code & ec = system::throws );
+ explicit stopwatch( system::error_code & ec = system::throws );
+ explicit stopwatch( const dont_start_t& t );
~timer();
- void start( system::error_code & ec = system::throws );
+ time_point start( system::error_code & ec = system::throws );
+ duration stop( system::error_code & ec = system::throws );
+ std::pair<duration,time_point> restart( system::error_code & ec = system::throws );
+
+ duration suspend( system::error_code & ec = system::throws );
+ time_point resume( system::error_code & ec = system::throws );
+
duration elapsed( system::error_code & ec = system::throws );
+
+ typedef stopwatch_runner<stopwatch<Clock> > scoped_run;
+ typedef stopwatch_suspender<stopwatch<Clock> > scoped_suspend;
+ typedef stopwatch_resumer<stopwatch<Clock> > scoped_resume;
+ typedef stopwatch_reporter<stopwatch<Clock> > reporter;
};
[endsect]
-[section `timer` useful typedefs]
+[section `stopwatch` useful typedefs]
- typedef boost::chrono::timer< boost::chrono::system_clock > system_timer;
+ typedef boost::chrono::stopwatch< boost::chrono::system_clock > system_stopwatch;
#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- typedef boost::chrono::timer< boost::chrono::monotonic_clock > monotonic_timer;
+ typedef boost::chrono::stopwatch< boost::chrono::monotonic_clock > monotonic_stopwatch;
#endif
- typedef boost::chrono::timer< boost::chrono::high_resolution_clock > high_resolution_timer;
+ typedef boost::chrono::stopwatch< boost::chrono::high_resolution_clock > high_resolution_stopwatch;
+
+ typedef boost::chrono::stopwatch< boost::chrono::process_real_cpu_clock > process_real_cpu_stopwatch;
+ typedef boost::chrono::stopwatch< boost::chrono::process_user_cpu_clock > process_user_cpu_stopwatch;
+ typedef boost::chrono::stopwatch< boost::chrono::process_system_cpu_clock > process_system_cpu_stopwatch;
+
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:stopwatch_accumulator_hpp Header `<boost/chrono/stopwatch_accumulator.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <class Clock, class Accumulator> class stopwatch_accumulator;
+ typedef <see below> system_stopwatch_accumulator;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef <see below> monotonic_stopwatch_accumulator;
+ #endif
+ typedef <see below> high_resolution_stopwatch_accumulator;
+
+ typedef <see below> process_real_cpu_stopwatch_accumulator;
+ typedef <see below> process_user_cpu_stopwatch_accumulator;
+ typedef <see below> process_system_cpu_stopwatch_accumulator;
+
+ }}
+
+
+[section Template Class `stopwatch_accumulator<>`]
+
+A `stopwatch_accumulator<>` is a model of a Stopwatch 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> class stopwatch_accumulator {
+ public:
+ typedef Clock clock;
+ typedef typename Clock::duration duration;
+ typedef typename Clock::time_point time_point;
+ typedef Accumulator accumulator;
+
+ stopwatch_accumulator();
+
+ time_point start( system::error_code & ec = system::throws );
+ duration stop( system::error_code & ec = system::throws );
+ std::pair<duration,time_point> restart( system::error_code & ec = system::throws );
+
+ duration suspend( system::error_code & ec = system::throws );
+ time_point resume( system::error_code & ec = system::throws );
+
+ duration elapsed(system::error_code & ec = system::throws);
+
+ accumulator& accumulated( );
+ void reset();
+
+ typedef stopwatch_runner<stopwatch_accumulator<Clock> > scoped_run;
+ typedef stopwatch_suspender<stopwatch_accumulator<Clock> > scoped_suspend;
+ typedef stopwatch_resumer<stopwatch_accumulator<Clock> > scoped_resume;
+ typedef stopwatch_reporter<stopwatch_accumulator<Clock> > reporter;
+ };
+
+[section:stopwatch_accumulator_c Constructor `stopwatch_accumulator()`]
+
+ stopwatch_accumulator();
+
+[*Effect:] Initialize the elapsed duration and the times counter to 0.
+
+[endsect]
+[section:stopwatch_accumulator_start Member function`start()`]
+
+ time_point start( system::error_code & ec = system::throws );
+
+[*Effect:] Starts running the stopwatch.
+
+[*Returns:] the starting time point.
+
+[*Throw:] Any exception the Clock::now function can throw.
+
+[endsect]
+[section:stopwatch_accumulator_stop Member function`stop()`]
+
+ duration stop( system::error_code & ec = system::throws );
+
+[*Effect:] Stops running the stopwatch. Accumulates the elapsed time since the last start-like operation + the partial accumulated by resume/suspend operation.
+
+[*Returns:] The cummulated elapsed time.
+
+[*Throw:] Any exception the Clock::now function can throw.
+
+[endsect]
+[section:stopwatch_accumulator_suspend Member function`suspend()`]
+
+ duration suspend( system::error_code & ec = system::throws );
+
+[*Effect:] Suspends the stopwatch. Accumulates the elapsed time since the last start-like operation on a partial duration.
+
+[*Throw:] Any exception the Clock::now function can throw.
+
+[endsect]
+[section:stopwatch_accumulator_resume Member function`resume()`]
+
+ time_point resume( system::error_code & ec = system::throws );
+
+[*Effect:] Resumes the stopwatch.
+
+[*Returns:] the starting time point.
+
+[*Throw:] Any exception the Clock::now function can throw.
+
+[endsect]
+
+[section:stopwatch_accumulator_restart Member function`restart()`]
+
+ time_point restart( system::error_code & ec = system::throws );
+
+[*Effect:] Stop/Start the stopwatch.
+
+[*Returns:] the starting time point.
+
+[*Throw:] Any exception the Clock::now function can throw.
+
+[endsect]
+[section:stopwatch_accumulator_reset Member function`reset()`]
+
+ void reset( );
+
+[*Effect:] Stop the stopwatch and reset the accumulator.
+
+[*Throw:] Nothing.
+
+[endsect]
+[section:stopwatch_accumulator_elapsed Member function`elapsed()`]
+
+ duration elapsed(system::error_code & ec = system::throws) const;
+
+[*Returns:] the cumulated elapsed time.
+
+[*Throw:] Nothing.
+
+[*Note:] the system::error_code & parameter is here to conform to the Timer concept.
+
+[endsect]
+
+[section:stopwatch_accumulator_accumulated Member function`accumulated()`]
+
+ accumulator& accumulated();
+
+[*Returns:] the assocaited accumulator.
+
+[*Throw:] Nothing.
+
+[endsect]
+
+[endsect]
+
+[section `stopwatch_accumulator` useful typedefs]
+
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::system_clock > system_stopwatch_accumulator;
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::monotonic_clock > monotonic_stopwatch_accumulator;
+#endif
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::high_resolution_clock > high_resolution_stopwatch_accumulator;
-[/
- typedef boost::chrono::timer< boost::chrono::process_real_cpu_clock > process_real_cpu_timer;
- typedef boost::chrono::timer< boost::chrono::process_user_cpu_clock > process_user_cpu_timer;
- typedef boost::chrono::timer< boost::chrono::process_system_cpu_clock > process_system_cpu_timer;
-]
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_stopwatch_accumulator;
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::process_user_cpu_clock > process_user_cpu_stopwatch_accumulator;
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_stopwatch_accumulator;
+
[endsect]
[endsect]
-[/
[/==================================================]
-[section:timer_hpp Header `<boost/chrono/reporting_timer.hpp>`]
+[section:stopwatch_scoped_hpp Header `<boost/chrono/stopwatch_scoped.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ template <class Clock> class stopwatch_runner;
+ template <class Clock> class stopwatch_suspender;
+ template <class Clock> class stopwatch_resumer;
+ }}
+
+Boost.Chrono provides some helper classes ensuring pairwised operations (start/stop, suspend/resume, resule/suspend).
+
+[section Template Class `stopwatch_runner<>`]
+
+This helper class ensures that the start/stop are pairwised. Start the associated accumulator at construction time, and stop it at destruction time.
+
+ template <class Stopwatch> class stopwatch_runner {
+ public:
+ typedef Stopwatch stopwatch_type;
+ stopwatch_runner(stopwatch_type & a, system::error_code & ec = system::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 Template Class `stopwatch_suspender<>`]
+
+This helper class ensures that the suspend/resume are pairwised. Suspend the associated accumulator at construction time, and resume it at destruction time.
+
+ template <class Stopwatch> class stopwatch_suspender {
+ public:
+ typedef Stopwatch stopwatch_type;
+ stopwatch_suspender(stopwatch_type & a, system::error_code & ec = system::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 Template Class `stopwatch_resumer<>`]
+
+This helper class ensures that the resume/suspend are pairwised. Resume the associated accumulator at construction time, and suspecd it at destruction time.
+
+ template <class Stopwatch> class stopwatch_resumer {
+ public:
+ typedef Stopwatch stopwatch_type;
+ stopwatch_resumer(stopwatch_type & a, system::error_code & ec = system::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]
+
+[/==================================================================]
+[section:process_stopwatches_hpp Header `<boost/chrono/process_stopwatches.hpp>`]
+[/==================================================================]
+
+
+ namespace boost { namespace chrono {
+
+ class process_stopwatches;
+
+ } }
+
+
+[section Class `process_stopwatches`]
+
+Knowing how long a program takes to execute is useful in both test and production environments. It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests.
+
+`process_stopwatches` is the `stopwatches<>` equivalent associated to the pseudo-clock `process_clocks`. It behaves like `stopwatches<>` but it uses the specific `process_clocks:now()` function.
+
+ class process_stopwatches {
+ public:
+ typedef process_clocks clock;
+ typedef process_clocks::duration duration;
+ typedef process_clocks::time_point time_point;
+
+ explicit process_stopwatches( system::error_code & ec = system::throws );
+
+ ~process_stopwatches();
+ void start( system::error_code & ec = system::throws );
+ void elapsed( process_clocks::durations & times, system::error_code & ec = system::throws );
+ };
+
+[endsect]
+[endsect]
+[endsect]
+[section Stopwatch Reporters]
+
+[/==================================================]
+[section:stopwatch_reporter_hpp Header `<boost/chrono/stopwatch_reporter.hpp>`]
[/==================================================]
namespace boost { namespace chrono {
- template <class Clock> class reporting_timer;
- typedef <see above> system_reporting_timer;
+ template <class Stopwatch>
+ struct stopwatch_reporter_default_formatter;
+
+ template <class Stopwatch, class Formatter=typename stopwatch_reporter_default_formatter<Stopwatch>::type>
+ class stopwatch_reporter;
+ typedef <see above> system_stopwatch_reporter;
#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- typedef <see above> monotonic_reporting_timer;
+ typedef <see above> monotonic_stopwatch_reporter;
#endif
- typedef <see above> high_resolution_reporting_timer;
- typedef <see above> process_real_cpu_reporting_timer;
- typedef <see above> process_user_cpu_reporting_timer;
- typedef <see above> process_system_cpu_reporting_timer;
+ typedef <see above> high_resolution_stopwatch_reporter;
+ typedef <see above> process_real_cpu_stopwatch_reporter;
+ typedef <see above> process_user_cpu_stopwatch_reporter;
+ typedef <see above> process_system_cpu_stopwatch_reporter;
}}
-[section Class `reporting_timer<>`]
+[section `Formatter` Requirements]
+
+A Formatter outputs on a given ostream a formatted string combining informations from a Stopwatch and the format and the double precission.
+
+A Stopwatch must meet the requirements in the following Table.
+
+In this table `F` denote Fromaters types, `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 Stopwatch Requirements
+ [[expression] [return type] [operational semantics]]
+ [[`F::output()`] [std::otream&] [The output stream.]]
+ [[`F::default_places()`] [`std::size_t`] [The precission 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 precission `p`.]]
+]
+
+[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 Template Class `stopwatch_reporter<>`]
-class `reporting_timer` provides a everything `timer<>` provides and in adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
+class `stopwatch_reporter` 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 Formatter::default_places.
+The default format is given by Formatter::default_format.
+
+ template <class Stopwatch, class Formatter>
+ class stopwatch_reporter : public Stopwatch {
+ public:
+ explicit stopwatch_reporter( system::error_code & ec = system::throws );
+ explicit stopwatch_reporter( std::ostream & os,
+ system::error_code & ec = system::throws );
+
+ explicit stopwatch_reporter( const std::string & format,
+ system::error_code & ec = system::throws );
+ explicit stopwatch_reporter( std::ostream & os, const std::string & format,
+ system::error_code & ec = system::throws );
+
+ explicit stopwatch_reporter( const std::string & format, int places,
+ system::error_code & ec = system::throws );
+ explicit stopwatch_reporter( std::ostream & os, const std::string & format, int places,
+ system::error_code & ec = system::throws );
+
+ explicit stopwatch_reporter( int places,
+ system::error_code & ec = system::throws );
+ explicit stopwatch_reporter( std::ostream & os, int places,
+ system::error_code & ec = system::throws );
+
+ explicit stopwatch_reporter( int places, const std::string & format,
+ system::error_code & ec = system::throws );
+ explicit stopwatch_reporter( std::ostream & os, int places, const std::string & format,
+ system::error_code & ec = system::throws );
+
+ ~stopwatch_reporter();
+
+ void report( system::error_code & ec = system::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 `stopwatch_reporter` useful typedefs]
+
+ typedef boost::chrono::stopwatch_reporter< boost::chrono::system_clock > system_stopwatch_reporter;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef boost::chrono::stopwatch_reporter< boost::chrono::monotonic_clock > monotonic_stopwatch_reporter;
+ #endif
+ typedef boost::chrono::stopwatch_reporter< boost::chrono::high_resolution_clock > high_resolution_stopwatch_reporter;
+ typedef boost::chrono::stopwatch_reporter< boost::chrono::process_real_cpu_clock > process_real_cpu_stopwatch_reporter;
+ typedef boost::chrono::stopwatch_reporter< boost::chrono::process_user_cpu_clock > process_user_cpu_stopwatch_reporter;
+ typedef boost::chrono::stopwatch_reporter< boost::chrono::process_system_cpu_clock > process_system_cpu_stopwatch_reporter;
+
+[endsect]
+
+[endsect]
+
+
+[/==================================================]
+[section:stopwatch_formatter_hpp Header `<boost/chrono/stopwatch_formatter.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ class stopwatch_formatter;
+ }}
+
+[section Class `stopwatch_formatter`]
+
+`stopwatch_formatter` is a model of `Formatter`.
+
+ class stopwatch_formatter {
+ public:
+ static std::ostream & m_cout();
+ static const int m_default_places = 3;
+ static const char * default_format;
+ static int default_places() { return m_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 "\\n%ts\\n", where
-* `%t` : the result of elapsed() when the reporting is done.
+* `%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.
- template <class Clock> class reporting_timer : timer<Clock> {
+[endsect]
+[endsect]
+
+[/==================================================]
+[section:stopwatch_accumulator_formatter_hpp Header `<boost/chrono/stopwatch_accumulator_formatter.hpp>`]
+[/==================================================]
+
+ namespace boost { namespace chrono {
+ class stopwatch_accumulator_formatter;
+ }}
+
+[section Class `stopwatch_accumulator_formatter`]
+
+`stopwatch_accumulator_formatter` is a model of `Formatter`
+
+ class stopwatch_accumulator_formatter {
+ public:
+ static std::ostream & m_cout();
+ static const int m_default_places = 3;
+ static const char * default_format;
+ static int default_places() { return m_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 "\\n"Count=%c times Sum=%ss Min=%ms Max=%Ms Mean=%as\\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.
+
+The time is given using the suffix "s" following the System International d'Unites Std.
+
+[endsect]
+
+[endsect]
+
+[/==================================================================]
+[section:process_process_stopwatches_reporter_hpp Header `<boost/chrono/process_stopwatches_reporter.hpp>`]
+[/==================================================================]
+
+
+ namespace boost { namespace chrono {
+
+ class process_stopwatches_reporter;
+
+ } }
+
+[section Class `process_stopwatches_reporter`]
+
+`process_stopwatches_reporter` is the `stopwatches_reporter<>` associated to the clock tuple `process_clocks`.
+
+class `process_stopwatches_reporter` provides a complete run time reporting package that can be invoked in a single line of code. The reporting is controled 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 "\\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.
+
+ class process_stopwatches_reporter : public process_timer {
public:
- explicit reporting_timer( system::error_code & ec = system::throws );
- explicit reporting_timer( std::ostream & os,
+ explicit process_stopwatches_reporter( system::error_code & ec = system::throws );
+ explicit process_stopwatches_reporter( std::ostream & os,
system::error_code & ec = system::throws );
- explicit reporting_timer( const std::string & format,
+ explicit process_stopwatches_reporter( const std::string & format,
system::error_code & ec = system::throws );
- explicit reporting_timer( std::ostream & os, const std::string & format,
+ process_stopwatches_reporter( std::ostream & os, const std::string & format,
system::error_code & ec = system::throws );
- explicit reporting_timer( const std::string & format, int places,
+ process_stopwatches_reporter( const std::string & format, int places,
system::error_code & ec = system::throws );
- explicit reporting_timer( std::ostream & os, const std::string & format, int places,
+ process_stopwatches_reporter( std::ostream & os, const std::string & format, int places,
system::error_code & ec = system::throws );
- explicit reporting_timer( int places,
+ explicit process_stopwatches_reporter( int places,
system::error_code & ec = system::throws );
- explicit reporting_timer( std::ostream & os, int places,
+ process_stopwatches_reporter( std::ostream & os, int places,
system::error_code & ec = system::throws );
- explicit reporting_timer( int places, const std::string & format,
+ process_stopwatches_reporter( int places, const std::string & format,
system::error_code & ec = system::throws );
- explicit reporting_timer( std::ostream & os, int places, const std::string & format,
+ process_stopwatches_reporter( std::ostream & os, int places, const std::string & format,
system::error_code & ec = system::throws );
- ~reporting_timer();
+ ~process_stopwatches_reporter();
+
+ void start( system::error_code & ec = system::throws );
void report( system::error_code & ec = system::throws );
+
+ void test_report( duration real_, duration user_, duration system_ );
bool reported() const;
-
static int default_places();
};
[endsect]
-[section `reporting_timer` useful typedefs]
+[endsect]
+
- typedef boost::chrono::reporting_timer< boost::chrono::system_clock > system_reporting_timer;
+[endsect]
+[section Deprecated Headers]
+[/==================================================]
+[section:timer_hpp Deprecated Header `<boost/chrono/timer.hpp>`]
+[/==================================================]
+
+This header has been replaced by the header <boost/chrono/stopwatch.hpp>.
+
+ namespace boost { namespace chrono {
+ template <class Clock=high_resolution_clock> class timer;
+ typedef <see above> system_timer;
#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- typedef boost::chrono::reporting_timer< boost::chrono::monotonic_clock > monotonic_reporting_timer;
+ typedef <see above> monotonic_timer;
#endif
- typedef boost::chrono::reporting_timer< boost::chrono::high_resolution_clock > high_resolution_reporting_timer;
- typedef boost::chrono::reporting_timer< boost::chrono::process_real_cpu_clock > process_real_cpu_reporting_timer;
- typedef boost::chrono::reporting_timer< boost::chrono::process_user_cpu_clock > process_user_cpu_reporting_timer;
- typedef boost::chrono::reporting_timer< boost::chrono::process_system_cpu_clock > process_system_cpu_reporting_timer;
+ typedef <see above> high_resolution_timer;
+ }}
-[endsect]
+[/
+ typedef <see above> process_real_cpu_timer;
+ typedef <see above> process_user_cpu_timer;
+ typedef <see above> process_system_cpu_timer;
+]
+[section Template Class `timer<>`]
+
+Knowing how long a part of a program takes to execute is useful in both test and production environments.
+A `timer` 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 coudl varies a great deal from one clock to another.
+
+ template <class Clock> class timer {
+ public:
+ typedef Clock clock;
+ typedef typename Clock::duration duration;
+ typedef typename Clock::time_point time_point;
+
+ explicit timer( system::error_code & ec = system::throws );
+
+ ~timer();
+
+ void start( system::error_code & ec = system::throws );
+ duration elapsed( system::error_code & ec = system::throws );
+
+ };
[endsect]
-Comment ]
+[section `timer` useful typedefs]
+
+ typedef boost::chrono::timer< boost::chrono::system_clock > system_timer;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef boost::chrono::timer< boost::chrono::monotonic_clock > monotonic_timer;
+ #endif
+ typedef boost::chrono::timer< boost::chrono::high_resolution_clock > high_resolution_timer;
+
+[/
+ typedef boost::chrono::timer< boost::chrono::process_real_cpu_clock > process_real_cpu_timer;
+ typedef boost::chrono::timer< boost::chrono::process_user_cpu_clock > process_user_cpu_timer;
+ typedef boost::chrono::timer< boost::chrono::process_system_cpu_clock > process_system_cpu_timer;
+]
+[endsect]
+[endsect]
[/==================================================================]
-[section:process_times_hpp Header `<boost/chrono/process_times.hpp>`]
+[section:process_times_hpp Deprecated Header `<boost/chrono/process_times.hpp>`]
[/==================================================================]
+This header has been deprecated. See the `<boost/chrono/process_clocks.hpp>`, `<boost/chrono/process_stopwatches.hpp>` and `<boost/chrono/process_stopwatches_reporter.hpp>` files.
namespace boost { namespace chrono {
class process_clock;
+ typedef <see below> process_times;
class process_timer;
class run_timer;
@@ -2035,14 +2716,21 @@
[section Class `process_times`]
struct process_times {
- process_clock::duration real; // real (i.e wall clock) time
- process_clock::duration user; // user cpu time
- process_clock::duration system; // system cpu time
+ process_clock::duration real; // real (i.e wall clock) time
+ process_clock::duration user; // user cpu time
+ process_clock::duration system; // system cpu time
};
[endsect]
[endsect]
+[section Typedef `process_times`]
+
+ typedef process_clock::process_times process_times;
+
+This is a synonym of process_clock::process_times included for backward compatibility.
+
+[endsect]
[section Class `process_timer`]
@@ -2066,7 +2754,7 @@
[endsect]
[section Class `run_timer`]
-class `run_timer` provides a complete run time reporting package that can be invoked in a single line of code. The reporting is controleed by two parameters:
+class `run_timer` provides a complete run time reporting package that can be invoked in a single line of code. The reporting is controled by two parameters:
* format : The output format
* places(precission): the number of decimal placess used.
@@ -2126,6 +2814,8 @@
[endsect]
+[endsect]
+
[/===============]
[section Examples]
@@ -3012,20 +3702,20 @@
[endsect]
[/============================]
-[section run_timer_example.cpp]
+[section process_stopwatches_reporter_example.cpp]
-Here is the run_timer_example.cpp program supplied with the Boost Chrono library:
+Here is the process_stopwatches_reporter_example.cpp program supplied with the Boost Chrono library:
-[/run_timer_example_cpp]
+[/process_stopwatches_reporter_example_cpp]
-When the run_timer t object is created, it starts timing. When it is destroyed at the end of the program, its destructor stops the timer and displays timing information on cout.
+When the process_stopwatches_reporter t object is created, it starts timing. When it is destroyed at the end of the program, its destructor stops the timer and displays timing information on cout.
#include <boost/chrono/process_times.hpp>
#include <cmath>
int main()
{
- boost::chrono::run_timer t;
+ boost::chrono::process_stopwatches_reporter t;
for ( long i = 0; i < 10000000; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -3043,9 +3733,9 @@
[/=============================]
-[section run_timer_example2.cpp]
+[section process_stopwatches_reporter_example2.cpp]
-The run_timer_example2.cpp program is the same, except that it supplies additional constructor arguments from the command line:
+The process_stopwatches_reporter_example2.cpp program is the same, except that it supplies additional constructor arguments from the command line:
#include <boost/system/timer.hpp>
#include <cmath>
@@ -3055,7 +3745,7 @@
const char * format = argc > 1 ? argv[1] : "%t cpu seconds\n";
int places = argc > 2 ? std::atoi( argv[2] ) : 2;
- boost::chrono::run_timer t( format, places );
+ boost::chrono::process_stopwatches_reporter t( format, places );
for ( long i = 0; i < 10000000; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -3065,16 +3755,16 @@
Here is the output for this program for several sets of command line arguments:
- run_timer_example2
+ process_stopwatches_reporter_example2
0.42 cpu seconds
- run_timer_example2 "%w wall clock seconds\n"
+ process_stopwatches_reporter_example2 "%w wall clock seconds\n"
0.41 wall clock seconds
- run_timer_example2 "%w wall clock seconds\n" 6
+ process_stopwatches_reporter_example2 "%w wall clock seconds\n" 6
0.421875 wall clock seconds
- run_timer_example2 "%t total CPU seconds\n" 3
+ process_stopwatches_reporter_example2 "%t total CPU seconds\n" 3
0.422 total CPU seconds
[endsect]
@@ -3116,7 +3806,7 @@
if ( verbose )
{ std::cout << "command: \"" << s.c_str() << "\"\n"; }
- boost::chrono::run_timer t;
+ boost::chrono::process_stopwatches_reporter t;
return std::system( s.c_str() );
}
@@ -3131,6 +3821,25 @@
[section:history Appendix A: History]
[/==================================]
+[section [*Version 0.3.0, December 20, 2009] ['New stopwatch feature + Bug fixes]]
+[*Features:]
+
+* independent cpu clocks for real, user, system process CPU time.
+* new Stopwatch concept measuring elapsed time between different points in time associated to the operations start, stop, suspend and resume.
+* stopwatch is a model Stopwatch measuring the elapsed time between the start and the stop operations.
+* stopwatch_accumulator is a model Stopwatch allowing to accumulate several time samples and give the average, ...
+* scoped helper classes allowing to pairwise start/stop operations, suspend/resume and resume/suspend a Stopwatch.
+* new Stopwatch Formatter concept
+* stopwatch_reporter is a generic class reporting elapsed time for the Stopwatch concept.
+* process_times.hpp has been deprecated, see process_clocks.hpp, process_stopwhatches.hpp and process_stopwhatches_reporter.hpp.
+* timer.hpp has been deprecated, see stopwatch.
+
+[*Bug Fixes]
+
+* Try to correct warning C4251: 'boost::chrono::run_timer::m_format' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'boost::chrono::run_timer', by don't including inlines functions using the std::string m_format.
+
+[endsect]
+
[section [*Version 0.2.1, December 13, 2009] ['Bug fixes]]
[*Bug Fixes]
@@ -3293,11 +4002,11 @@
[section:implementation Appendix C: Implementation Notes]
-[heading Why does run_timer only display millisecond place precision when the underlying timer has nanosecond precision?]
+[heading Why does process_stopwatches_reporter only display millisecond place precision when the underlying timer 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 run_timer sometimes report more cpu seconds than real seconds?]
+[heading Why does process_stopwatches_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.
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -29,6 +29,8 @@
<div class="toc"><dl>
<dt><span class="section"> Appendix A: History</span></dt>
<dd><dl>
+<dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_3_0__december_20__2009____new_stopwatch_feature___bug_fixes_"><span class="bold"><strong>Version 0.3.0, December 20, 2009</strong></span> <span class="emphasis"><em>New stopwatch
+ feature + Bug fixes</em></span></a></span></dt>
<dt><span class="section">Version 0.2.1, December 13, 2009 Bug fixes</span></dt>
<dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_2_0__december_8__2009______features___bug_fixes___updated_documentation_"><span class="bold"><strong>Version 0.2.0, December 8, 2009</strong></span> <span class="emphasis"><em>+ Features
+ Bug fixes + Updated documentation</em></span></a></span></dt>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -27,6 +27,8 @@
<a name="boost_chrono.appendices.history"></a> Appendix A: History
</h3></div></div></div>
<div class="toc"><dl>
+<dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_3_0__december_20__2009____new_stopwatch_feature___bug_fixes_"><span class="bold"><strong>Version 0.3.0, December 20, 2009</strong></span> <span class="emphasis"><em>New stopwatch
+ feature + Bug fixes</em></span></a></span></dt>
<dt><span class="section">Version 0.2.1, December 13, 2009 Bug fixes</span></dt>
<dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_2_0__december_8__2009______features___bug_fixes___updated_documentation_"><span class="bold"><strong>Version 0.2.0, December 8, 2009</strong></span> <span class="emphasis"><em>+ Features
+ Bug fixes + Updated documentation</em></span></a></span></dt>
@@ -35,6 +37,60 @@
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.appendices.history.__version_0_3_0__december_20__2009____new_stopwatch_feature___bug_fixes_"></a><a href="history.html#boost_chrono.appendices.history.__version_0_3_0__december_20__2009____new_stopwatch_feature___bug_fixes_" title="Version 0.3.0, December 20, 2009 New stopwatch
+ feature + Bug fixes"><span class="bold"><strong>Version 0.3.0, December 20, 2009</strong></span> <span class="emphasis"><em>New stopwatch
+ feature + Bug fixes</em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ independent cpu clocks for real, user, system process CPU time.
+ </li>
+<li>
+ new Stopwatch concept measuring elapsed time between different points
+ in time associated to the operations start, stop, suspend and resume.
+ </li>
+<li>
+ stopwatch is a model Stopwatch measuring the elapsed time between the
+ start and the stop operations.
+ </li>
+<li>
+ stopwatch_accumulator is a model Stopwatch allowing to accumulate several
+ time samples and give the average, ...
+ </li>
+<li>
+ scoped helper classes allowing to pairwise start/stop operations, suspend/resume
+ and resume/suspend a Stopwatch.
+ </li>
+<li>
+ new Stopwatch Formatter concept
+ </li>
+<li>
+ stopwatch_reporter is a generic class reporting elapsed time for the
+ Stopwatch concept.
+ </li>
+<li>
+ process_times.hpp has been deprecated, see process_clocks.hpp, process_stopwhatches.hpp
+ and process_stopwhatches_reporter.hpp.
+ </li>
+<li>
+ timer.hpp has been deprecated, see stopwatch.
+ </li>
+</ul></div>
+<p>
+ <span class="bold"><strong>Bug Fixes</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ Try to correct warning C4251: 'boost::chrono::run_timer::m_format' :
+ class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface
+ to be used by clients of class 'boost::chrono::run_timer', by don't including
+ inlines functions using the std::string m_format.
+ </li></ul></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
<a name="boost_chrono.appendices.history.__version_0_2_1__december_13__2009____bug_fixes_"></a>Version 0.2.1, December 13, 2009 Bug fixes
</h4></div></div></div>
<p>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -30,21 +30,22 @@
Implementation Notes"> Appendix C:
Implementation Notes</a>
</h3></div></div></div>
-<a name="boost_chrono.appendices.implementation.why_does_run_timer_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_"></a><h4>
-<a name="id4882086"></a>
- <a href="implementation.html#boost_chrono.appendices.implementation.why_does_run_timer_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_">Why
- does run_timer only display millisecond place precision when the underlying
- timer has nanosecond precision?</a>
+<a name="boost_chrono.appendices.implementation.why_does_process_stopwatches_reporter_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_"></a><h4>
+<a name="id4899920"></a>
+ <a href="implementation.html#boost_chrono.appendices.implementation.why_does_process_stopwatches_reporter_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_">Why
+ does process_stopwatches_reporter only display millisecond place precision
+ when the underlying timer has nanosecond precision?</a>
</h4>
<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.appendices.implementation.why_does_run_timer_sometimes_report_more_cpu_seconds_than_real_seconds_"></a><h4>
-<a name="id4882127"></a>
- <a href="implementation.html#boost_chrono.appendices.implementation.why_does_run_timer_sometimes_report_more_cpu_seconds_than_real_seconds_">Why
- does run_timer sometimes report more cpu seconds than real seconds?</a>
+<a name="boost_chrono.appendices.implementation.why_does_process_stopwatches_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_"></a><h4>
+<a name="id4899959"></a>
+ <a href="implementation.html#boost_chrono.appendices.implementation.why_does_process_stopwatches_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_">Why
+ does process_stopwatches_reporter sometimes report more cpu seconds than
+ real seconds?</a>
</h4>
<p>
Ask your operating system supplier. The results have been inspected with
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -33,7 +33,7 @@
are an extract from this document.
</p>
<a name="boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a__code__phrase_role__identifier__duration__phrase___code__to_a_function_with_the_units_being_ambiguous_"></a><h4>
-<a name="id4880918"></a>
+<a name="id4898752"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a__code__phrase_role__identifier__duration__phrase___code__to_a_function_with_the_units_being_ambiguous_">Is
it possible for the user to pass a <code class="computeroutput"><span class="identifier">duration</span></code>
to a function with the units being ambiguous?</a>
@@ -45,7 +45,7 @@
<pre class="programlisting"><span class="identifier">f</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// Will not compile, 3 is not implicitly convertible to any `duration`
</span></pre>
<a name="boost_chrono.appendices.rationale.why_duration_needs_operator_"></a><h4>
-<a name="id4881008"></a>
+<a name="id4898840"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.why_duration_needs_operator_">Why
duration needs operator%</a>
</h4>
@@ -73,7 +73,7 @@
<span class="special">};</span>
</pre>
<a name="boost_chrono.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form"></a><h4>
-<a name="id4881586"></a>
+<a name="id4899419"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form">Why
ratio needs CopyConstruction and Assignment from ratios having the same normalized
form</a>
@@ -102,7 +102,7 @@
succeeds.
</p>
<a name="boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
-<a name="id4881875"></a>
+<a name="id4899708"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type">Why
ratio needs the nested normalizer typedef type</a>
</h4>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -27,7 +27,7 @@
<a name="boost_chrono.appendices.todo"></a> Appendix F: Future plans
</h3></div></div></div>
<a name="boost_chrono.appendices.todo.tasks_to_do_before_review"></a><h4>
-<a name="id4882722"></a>
+<a name="id4900558"></a>
<a href="todo.html#boost_chrono.appendices.todo.tasks_to_do_before_review">Tasks
to do before review</a>
</h4>
@@ -61,7 +61,7 @@
> high resolution timers to avoid these issues.
</p>
<a name="boost_chrono.appendices.todo.for_later_releases"></a><h4>
-<a name="id4882780"></a>
+<a name="id4900616"></a>
<a href="todo.html#boost_chrono.appendices.todo.for_later_releases">For later
releases</a>
</h4>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,8 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="../index.html" title="Boost.Chrono">
<link rel="up" href="../index.html" title="Boost.Chrono">
-<link rel="prev" href="reference/process_times_hpp.html" title=" Header <boost/chrono/process_times.hpp>">
+<link rel="prev" href="reference/deprecated_headers.html" title="Deprecated
+ Headers">
<link rel="next" href="examples/si_units.html" title="SI-units">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +21,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="reference/process_times_hpp.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="examples/si_units.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="reference/deprecated_headers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="examples/si_units.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -42,8 +43,8 @@
Hinnant's original demonstration program</a></span></dt>
<dt><span class="section"><a href="examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html">A
tiny program that times how long until a key is struck</a></span></dt>
-<dt><span class="section">run_timer_example.cpp</span></dt>
-<dt><span class="section">run_timer_example2.cpp</span></dt>
+<dt><span class="section">process_stopwatches_reporter_example.cpp</span></dt>
+<dt><span class="section">process_stopwatches_reporter_example2.cpp</span></dt>
<dt><span class="section">time command</span></dt>
</dl></div>
</div>
@@ -57,7 +58,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="reference/process_times_hpp.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="examples/si_units.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="reference/deprecated_headers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="examples/si_units.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -9,7 +9,7 @@
<link rel="up" href="../examples.html" title="Examples">
<link rel="prev" href="howard_hinnant_s_original_demonstration_program.html" title="Howard
Hinnant's original demonstration program">
-<link rel="next" href="run_timer_example_cpp.html" title="run_timer_example.cpp">
+<link rel="next" href="process_stopwatches_reporter_example_cpp.html" title="process_stopwatches_reporter_example.cpp">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -22,7 +22,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="howard_hinnant_s_original_demonstration_program.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="run_timer_example_cpp.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="howard_hinnant_s_original_demonstration_program.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="process_stopwatches_reporter_example_cpp.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -106,7 +106,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="howard_hinnant_s_original_demonstration_program.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="run_timer_example_cpp.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="howard_hinnant_s_original_demonstration_program.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="process_stopwatches_reporter_example_cpp.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/process_stopwatches_reporter_example2_cpp.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/process_stopwatches_reporter_example2_cpp.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,78 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>process_stopwatches_reporter_example2.cpp</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../examples.html" title="Examples">
+<link rel="prev" href="process_stopwatches_reporter_example_cpp.html" title="process_stopwatches_reporter_example.cpp">
+<link rel="next" href="time_command.html" title="time command">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="process_stopwatches_reporter_example_cpp.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="time_command.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.examples.process_stopwatches_reporter_example2_cpp"></a>process_stopwatches_reporter_example2.cpp
+</h3></div></div></div>
+<p>
+ The process_stopwatches_reporter_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">system</span><span class="special">/</span><span class="identifier">timer</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><span class="identifier">process_stopwatches_reporter</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">process_stopwatches_reporter_example2</span>
+<span class="number">0.42</span> <span class="identifier">cpu</span> <span class="identifier">seconds</span>
+
+<span class="identifier">process_stopwatches_reporter_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">process_stopwatches_reporter_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">process_stopwatches_reporter_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>
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="process_stopwatches_reporter_example_cpp.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="time_command.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/process_stopwatches_reporter_example_cpp.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/process_stopwatches_reporter_example_cpp.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,77 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>process_stopwatches_reporter_example.cpp</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../examples.html" title="Examples">
+<link rel="prev" href="a_tiny_program_that_times_how_long_until_a_key_is_struck.html" title="A
+ tiny program that times how long until a key is struck">
+<link rel="next" href="process_stopwatches_reporter_example2_cpp.html" title="process_stopwatches_reporter_example2.cpp">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="a_tiny_program_that_times_how_long_until_a_key_is_struck.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="process_stopwatches_reporter_example2_cpp.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.examples.process_stopwatches_reporter_example_cpp"></a>process_stopwatches_reporter_example.cpp
+</h3></div></div></div>
+<p>
+ Here is the process_stopwatches_reporter_example.cpp program supplied with
+ the Boost Chrono library:
+ </p>
+<p>
+ When the process_stopwatches_reporter t object is created, it starts timing.
+ When it is destroyed at the end of the program, its destructor stops the
+ timer 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">process_times</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><span class="identifier">process_stopwatches_reporter</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 on a circa 2006 processor looks was 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>
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="a_tiny_program_that_times_how_long_until_a_key_is_struck.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="process_stopwatches_reporter_example2_cpp.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/time_command.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/time_command.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/examples/time_command.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="../../index.html" title="Boost.Chrono">
<link rel="up" href="../examples.html" title="Examples">
-<link rel="prev" href="run_timer_example2_cpp.html" title="run_timer_example2.cpp">
+<link rel="prev" href="process_stopwatches_reporter_example2_cpp.html" title="process_stopwatches_reporter_example2.cpp">
<link rel="next" href="../appendices.html" title="Appendices">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="run_timer_example2_cpp.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../appendices.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="process_stopwatches_reporter_example2_cpp.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../appendices.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
@@ -60,7 +60,7 @@
<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><span class="identifier">run_timer</span> <span class="identifier">t</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_stopwatches_reporter</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>
@@ -76,7 +76,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="run_timer_example2_cpp.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../appendices.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="process_stopwatches_reporter_example2_cpp.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../appendices.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -35,7 +35,7 @@
<dt><span class="section">Duration</span></dt>
<dt><span class="section">Clocks</span></dt>
<dt><span class="section">Time Point</span></dt>
-<dt><span class="section">Timers</span></dt>
+<dt><span class="section">Stopwatches</span></dt>
</dl></dd>
<dt><span class="section">Caveat emptor</span></dt>
</dl></div>
@@ -73,33 +73,63 @@
</ul></div>
</li>
<li>
- Class template timer, with typedefs:
+ Process clocks:
<div class="itemizedlist"><ul type="circle">
-<li><code class="computeroutput"><span class="identifier">system_timer</span></code></li>
-<li><code class="computeroutput"><span class="identifier">monotonic_timer</span></code></li>
-<li><code class="computeroutput"><span class="identifier">high_resolution_timer</span></code></li>
+<li>
+<code class="computeroutput"><span class="identifier">process_real_CPU_clocks</span></code>,
+ capturing real-CPU times.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">process_user_CPU_clocks</span></code>,
+ capturing user-CPU times.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">process_system_CPU_clocks</span></code>,
+ capturing system-CPU times.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">process_clocks</span></code>, tuple-like
+ class capturing at once real, user-CPU, and system-CPU times.
+ </li>
</ul></div>
</li>
<li>
- Process clocks and timers:
+ Stopwatches:
<div class="itemizedlist"><ul type="circle">
<li>
-<code class="computeroutput"><span class="identifier">process_clock</span></code>, capturing
- real, user-CPU, and system-CPU times.
+<code class="computeroutput"><span class="identifier">stopwatch</span></code>, capturing
+ elapsed Clock times.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code>,
+ capturing cummulated elapsed Clock times.
+ </li>
+<li>
+ scoped helper classes allowing to pairwise start/stop operations, suspend/resume
+ and resume/suspend a Stopwatch.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">process_stopwatches</span></code>,
+ capturing elapsed real, user-CPU, and system-CPU times.
</li>
+</ul></div>
+</li>
+<li>
+ Stopwatch reporters:
+ <div class="itemizedlist"><ul type="circle">
<li>
-<code class="computeroutput"><span class="identifier">process_timer</span></code>, capturing
- elapsed real, user-CPU, and system-CPU times.
+<code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code>, convenient
+ reporting of models of Stopwatch results.
</li>
<li>
-<code class="computeroutput"><span class="identifier">run_timer</span></code>, convenient
- reporting of process_timer results.
+<code class="computeroutput"><span class="identifier">process_stopwatches_reporter</span></code>,
+ convenient reporting of process_stopwatches results.
</li>
</ul></div>
</li>
</ul></div>
<a name="boost_chrono.overview.how_to_use_this_documentation"></a><h3>
-<a name="id4764955"></a>
+<a name="id4765014"></a>
<a href="overview.html#boost_chrono.overview.how_to_use_this_documentation">How to
Use This Documentation</a>
</h3>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -33,7 +33,7 @@
<dt><span class="section">Duration</span></dt>
<dt><span class="section">Clocks</span></dt>
<dt><span class="section">Time Point</span></dt>
-<dt><span class="section">Timers</span></dt>
+<dt><span class="section">Stopwatches</span></dt>
</dl></div>
<p>
See N2661 - A Foundation to Sleep On which is
@@ -237,7 +237,7 @@
needs only 23 bits to cover that range.
</p>
<a name="boost_chrono.overview.motivation.duration.so_what_exactly_is_a__code__phrase_role__identifier__duration__phrase___code__and_how_do_i_use_one_"></a><h5>
-<a name="id4759345"></a>
+<a name="id4759672"></a>
<a href="motivation.html#boost_chrono.overview.motivation.duration.so_what_exactly_is_a__code__phrase_role__identifier__duration__phrase___code__and_how_do_i_use_one_">So
What Exactly is a <code class="computeroutput"><span class="identifier">duration</span></code>
and How Do I Use One?</a>
@@ -295,7 +295,7 @@
instead of inheritance).
</p>
<a name="boost_chrono.overview.motivation.duration.what_happens_if_i_assign__code__phrase_role__identifier__m3__phrase___phrase_role__special_____phrase___phrase_role__identifier__us3__phrase___code__to__code__phrase_role__identifier__minutes__phrase___code__instead_of__code__phrase_role__identifier__microseconds__phrase___code__"></a><h5>
-<a name="id4759354"></a>
+<a name="id4813150"></a>
<a href="motivation.html#boost_chrono.overview.motivation.duration.what_happens_if_i_assign__code__phrase_role__identifier__m3__phrase___phrase_role__special_____phrase___phrase_role__identifier__us3__phrase___code__to__code__phrase_role__identifier__minutes__phrase___code__instead_of__code__phrase_role__identifier__microseconds__phrase___code__">What
happens if I assign <code class="computeroutput"><span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span></code>
to <code class="computeroutput"><span class="identifier">minutes</span></code> instead of
@@ -312,7 +312,7 @@
ignored. This is similar to the problem of assigning a double to an <code class="computeroutput"><span class="keyword">int</span></code>: the fractional part gets silently discarded.
</p>
<a name="boost_chrono.overview.motivation.duration.but_what_if_the_truncation_behavior_is_what_i_want_to_do_"></a><h5>
-<a name="id4813279"></a>
+<a name="id4813318"></a>
<a href="motivation.html#boost_chrono.overview.motivation.duration.but_what_if_the_truncation_behavior_is_what_i_want_to_do_">But
what if the truncation behavior is what I want to do?</a>
</h5>
@@ -332,7 +332,7 @@
as often as it can.
</p>
<a name="boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point__code__phrase_role__identifier__duration__phrase___code_s__i_don_t_want_to_deal_with_writing__code__phrase_role__identifier__duration_cast__phrase___code__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation"></a><h5>
-<a name="id4813416"></a>
+<a name="id4813455"></a>
<a href="motivation.html#boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point__code__phrase_role__identifier__duration__phrase___code_s__i_don_t_want_to_deal_with_writing__code__phrase_role__identifier__duration_cast__phrase___code__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation">I'm
trafficking in floating point <code class="computeroutput"><span class="identifier">duration</span></code>s.
I don't want to deal with writing <code class="computeroutput"><span class="identifier">duration_cast</span></code>
@@ -347,7 +347,7 @@
<span class="identifier">dminutes</span> <span class="identifier">dm4</span> <span class="special">=</span> <span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span><span class="special">;</span> <span class="comment">// dm4.count() == 5.000000083333333
</span></pre>
<a name="boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_"></a><h5>
-<a name="id4813578"></a>
+<a name="id4813617"></a>
<a href="motivation.html#boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_">How
expensive is all of this?</a>
</h5>
@@ -361,7 +361,7 @@
tick counts.
</p>
<a name="boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a__code__phrase_role__identifier__duration__phrase___code__parameter_"></a><h5>
-<a name="id4813628"></a>
+<a name="id4813667"></a>
<a href="motivation.html#boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a__code__phrase_role__identifier__duration__phrase___code__parameter_">How
complicated is it to build a function taking a <code class="computeroutput"><span class="identifier">duration</span></code>
parameter?</a>
@@ -583,7 +583,7 @@
the relationship between the epochs associated with each clock is known.
</p>
<a name="boost_chrono.overview.motivation.time_point.so_what_exactly_is_a__code__phrase_role__identifier__time_point__phrase___code__and_how_do_i_use_one_"></a><h5>
-<a name="id4815433"></a>
+<a name="id4815472"></a>
<a href="motivation.html#boost_chrono.overview.motivation.time_point.so_what_exactly_is_a__code__phrase_role__identifier__time_point__phrase___code__and_how_do_i_use_one_">So
What Exactly is a <code class="computeroutput"><span class="identifier">time_point</span></code>
and How Do I Use One?</a>
@@ -666,34 +666,81 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.timers"></a>Timers
+<a name="boost_chrono.overview.motivation.stopwatches"></a>Stopwatches
</h4></div></div></div>
<p>
- Knowing how long a program takes to execute is useful in both test and
- production environments. It is also helpful if such timing information
- is broken down into real (wall clock) time, CPU time spent by the user,
- and CPU time spent by the operating system servicing user requests.
+ 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</strong></span>
+ introduces the Stopwatch concept which captures the mechanism to measure
+ the elapsed time. <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code> is the basic model of Stopwatch
</p>
<p>
- The Boost Chrono Library's process times components provide that information:
+ It is also interesting to have an statisitical view of these times. <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code>
+ associates an accumulator with a stopwatch, so we are able to retrieve
+ any statistical feature Boost.Accumulator provides. the Aprovides stopwatches
+ utilities useful when the automatic reporting of <code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code>
+ isn't desired.
</p>
-<div class="itemizedlist"><ul type="disc">
-<li>
- At the highest level, class <code class="computeroutput"><span class="identifier">run_timer</span></code>
- provides a complete run time reporting package that can be invoked in
- a single line of code.
- </li>
-<li>
- At a middle level, class <code class="computeroutput"><span class="identifier">process_timer</span></code>
- provides a process timer useful when the automatic reporting of <code class="computeroutput"><span class="identifier">run_timer</span></code> isn't desired.
- </li>
-<li>
- At the lowest level, <code class="computeroutput"><span class="identifier">process_clock</span></code>
- provides a thin wrapper around the operating system's process timer API.
- For POSIX-like systems, that's the times() function, while for Windows,
- it's the GetProcessTimes() function.
- </li>
-</ul></div>
+<p>
+ The highest level use case of measuring the elapsed time is to report these
+ times on the display. <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><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 Clock.
+ </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> <span class="identifier">stopwatch_accumulator</span><span class="special"><>::</span><span class="identifier">reporter</span> <span class="identifier">sw</span><span class="special">;</span>
+ <span class="identifier">stopwatch_accumulator</span><span class="special"><>::</span><span class="identifier">reporter</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="identifier">Count</span><span class="special">=</span><span class="number">3</span> <span class="identifier">times</span> <span class="identifier">Sum</span><span class="special">=</span><span class="number">0.034</span><span class="identifier">s</span> <span class="identifier">Min</span><span class="special">=</span><span class="number">0.006</span><span class="identifier">s</span> <span class="identifier">Max</span><span class="special">=</span><span class="number">0.017</span><span class="identifier">s</span> <span class="identifier">Mean</span><span class="special">=</span><span class="number">0.011</span><span class="identifier">s</span>
+</pre>
+<p>
+ It is also helpful if such timing information is broken down into real
+ (wall clock) time, CPU time spent by the user, and CPU time spent by the
+ operating system servicing user requests. <code class="computeroutput"><span class="identifier">process_real_CPU_clock</span></code>,
+ <code class="computeroutput"><span class="identifier">process_user_CPU_clock</span></code>,
+ <code class="computeroutput"><span class="identifier">process_system_CPU_clock</span></code>
+ and <code class="computeroutput"><span class="identifier">process_clocks</span></code> provides
+ a thin wrappers around the operating system's process timer API. The first
+ three captre the a specific time unitarily, the last captures the three
+ times at once. For POSIX-like systems, that's the times() function, while
+ for Windows, it's the GetProcessTimes() function.
+ </p>
+<p>
+ As <code class="computeroutput"><span class="identifier">process_clocks</span></code> do not
+ conform to the Stopwatch concept, <span class="bold"><strong>Boost.Chrono</strong></span>
+ provides the equivalent of <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">process_clocks</span><span class="special">></span></code> and <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">process_clocks</span><span class="special">></span></code> with the classes <code class="computeroutput"><span class="identifier">process_stopwatches</span></code>
+ and <code class="computeroutput"><span class="identifier">process_stopwatches_reporter</span></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>
+ <span class="identifier">process_stopwatches_reporter</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>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -7,7 +7,8 @@
<link rel="start" href="../index.html" title="Boost.Chrono">
<link rel="up" href="../index.html" title="Boost.Chrono">
<link rel="prev" href="users_guide/ext_references.html" title=" References">
-<link rel="next" href="reference/common_type_hpp.html" title=" Header <boost/type_traits/common_type.hpp>">
+<link rel="next" href="reference/cpp0x.html" title=" Included on the C++0x
+ recommendation">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,67 +21,56 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="users_guide/ext_references.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference/common_type_hpp.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="users_guide/ext_references.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference/cpp0x.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_chrono.reference"></a> Reference
</h2></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"> Header <boost/type_traits/common_type.hpp>
</span></dt>
-<dd><dl><dt><span class="section"><a href="reference/common_type_hpp.html#boost_chrono.reference.common_type_hpp.common_type">
- Class Template <code class="computeroutput"><span class="identifier">common_type</span></code></a></span></dt></dl></dd>
-<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
+<dt><span class="section"><a href="reference/cpp0x.html"> Included on the C++0x
+ recommendation</a></span></dt>
<dd><dl>
-<dt><span class="section"><a href="reference/ratio_hpp.html#boost_chrono.reference.ratio_hpp.ratio"> Class Template
- <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section"><a href="reference/ratio_hpp.html#boost_chrono.reference.ratio_hpp.ratio_arithmetic">
- <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a></span></dt>
-<dt><span class="section"><a href="reference/ratio_hpp.html#boost_chrono.reference.ratio_hpp.ratio_comparison">
- <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</a></span></dt>
-<dt><span class="section"><a href="reference/ratio_hpp.html#boost_chrono.reference.ratio_hpp.ration_SI_typedefs">
- SI typedefs</a></span></dt>
+<dt><span class="section"><a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp"> Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">common_type</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
+<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
+<dt><span class="section"> Header <boost/chrono.hpp>
</span></dt>
</dl></dd>
-<dt><span class="section"> Header <boost/chrono.hpp>
</span></dt>
+<dt><span class="section"><a href="reference/process_cpu_related.html">Process CPU
+ related</a></span></dt>
+<dd><dl><dt><span class="section"><a href="reference/process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_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">process_clocks</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">Clock
Requirements</span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.time_related_traits">Time-related
- traits</a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.class_template__duration_">Class
- template <code class="computeroutput"><span class="identifier">duration</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.duration_non_member_arithmetic">duration
- non-member arithmetic</a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.duration_comparaisons">duration
- comparaisons</a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.duration_cast"> Non-Member
- function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.class_template__time_point_">Class
- template <code class="computeroutput"><span class="identifier">time_point</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.time_point_non_member_arithmetic">time_point
- non-member arithmetic</a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.time_point_comparisons">time_point
- comparisons</a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.class__system_clock_">Class
- <code class="computeroutput"><span class="identifier">system_clock</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.class__monotonic_clock_">Class
- <code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/chrono_hpp.html#boost_chrono.reference.chrono_hpp.class__high_resolution_clock_">Class
- <code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a></span></dt>
+<dt><span class="section">Stopwatch
Requirements</span></dt>
+<dt><span class="section"><a href="reference/stopwatches.html#boost_chrono.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">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/stopwatches.html#boost_chrono.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">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/stopwatches.html#boost_chrono.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">stopwatch_scoped</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/stopwatches.html#boost_chrono.reference.stopwatches.process_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">process_stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
</dl></dd>
-<dt><span class="section"> Header <boost/chrono/timer.hpp>
</span></dt>
+<dt><span class="section"><a href="reference/stopwatch_reporters.html">Stopwatch
+ Reporters</a></span></dt>
<dd><dl>
-<dt><span class="section"><a href="reference/timer_hpp.html#boost_chrono.reference.timer_hpp.template_class__timer___">Template
- Class <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section">timer
useful typedefs</span></dt>
+<dt><span class="section"><a href="reference/stopwatch_reporters.html#boost_chrono.reference.stopwatch_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">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/stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.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">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/stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.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">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/stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_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">process_stopwatches_reporter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
</dl></dd>
-<dt><span class="section"> Header <boost/chrono/process_times.hpp>
</span></dt>
+<dt><span class="section"><a href="reference/deprecated_headers.html">Deprecated
+ Headers</a></span></dt>
<dd><dl>
-<dt><span class="section"><a href="reference/process_times_hpp.html#boost_chrono.reference.process_times_hpp.class__process_clock_">Class
- <code class="computeroutput"><span class="identifier">process_clock</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/process_times_hpp.html#boost_chrono.reference.process_times_hpp.class__process_timer_">Class
- <code class="computeroutput"><span class="identifier">process_timer</span></code></a></span></dt>
-<dt><span class="section"><a href="reference/process_times_hpp.html#boost_chrono.reference.process_times_hpp.class__run_timer_">Class
- <code class="computeroutput"><span class="identifier">run_timer</span></code></a></span></dt>
+<dt><span class="section"><a href="reference/deprecated_headers.html#boost_chrono.reference.deprecated_headers.timer_hpp">
+ Deprecated 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">timer</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/deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp">
+ Deprecated 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">process_times</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
</dl></dd>
</dl></div>
</div>
@@ -94,7 +84,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="users_guide/ext_references.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference/common_type_hpp.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="users_guide/ext_references.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference/cpp0x.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,2183 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Included on the C++0x
+ recommendation</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../reference.html" title=" Reference ">
+<link rel="prev" href="../reference.html" title=" Reference ">
+<link rel="next" href="process_cpu_related.html" title="Process CPU
+ related">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="process_cpu_related.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.reference.cpp0x"></a><a href="cpp0x.html" title=" Included on the C++0x
+ recommendation"> Included on the C++0x
+ recommendation</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp"> Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">common_type</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="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type">
+ Class Template <code class="computeroutput"><span class="identifier">common_type</span></code></a></span></dt></dl></dd>
+<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio"> Class
+ Template <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs">
+ SI typedefs</a></span></dt>
+</dl></dd>
+<dt><span class="section"> Header <boost/chrono.hpp>
</span></dt>
+<dd><dl>
+<dt><span class="section">Clock
Requirements</span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits">Time-related
+ traits</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_">Class
+ template <code class="computeroutput"><span class="identifier">duration</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic">duration
+ non-member arithmetic</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons">duration
+ comparaisons</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_cast">
+ Non-Member function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_">Class
+ template <code class="computeroutput"><span class="identifier">time_point</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic">time_point
+ non-member arithmetic</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons">time_point
+ comparisons</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_">Class
+ <code class="computeroutput"><span class="identifier">system_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__monotonic_clock_">Class
+ <code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__high_resolution_clock_">Class
+ <code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.cpp0x.common_type_hpp"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp" title=" Header
+ <boost/type_traits/common_type.hpp>"> Header
+ <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">common_type</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="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type">
+ Class Template <code class="computeroutput"><span class="identifier">common_type</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">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="special">...</span><span class="identifier">T</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.common_type_hpp.common_type"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type">
+ Class Template <code class="computeroutput"><span class="identifier">common_type</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">common_type</span></code> is a facility
+ which is useful in specifying the type of the result of functions and
+ operators which take a variety of types (e.g. "mixed mode"
+ complex arithmetic).
+ </p>
+<p>
+ The nested typedef <code class="computeroutput"><span class="identifier">common_type</span><span class="special">::</span><span class="identifier">type</span></code>
+ could be defined as follows:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">common_type</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">V</span><span class="special">>::</span><span class="identifier">type</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">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="keyword">void</span><span class="special">,</span> <span class="keyword">void</span><span class="special">></span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">T</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">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">,</span> <span class="keyword">void</span><span class="special">></span> <span class="special">{</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="keyword">static</span> <span class="identifier">T</span> <span class="identifier">m_t</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="identifier">U</span> <span class="identifier">m_u</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">m_f</span><span class="special">();</span> <span class="comment">// workaround gcc bug; not required by std
+</span><span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">BOOST_TYPEOF_TPL</span><span class="special">(</span><span class="identifier">m_f</span><span class="special">()</span> <span class="special">?</span> <span class="identifier">m_t</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">m_u</span><span class="special">())</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ All parameter types must be complete. This trait is permitted to be specialized
+ by a user if at least one template parameter is a user-defined type.
+ </p>
+<p>
+ <span class="bold"><strong>Note:</strong></span> Such specializations are required
+ when only explicit conversions are desired among the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ arguments.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.cpp0x.ratio_hpp"></a> Header <boost/ratio.hpp>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio"> Class
+ Template <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs">
+ SI typedefs</a></span></dt>
+</dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">ratio</span></code> is a facility which
+ is useful in specifying compile time rational constants. Compile time rational
+ arithmetic is supported with protection against overflow and divide by
+ zero. Such a facility is very handy when needing to efficiently represent
+ 1/3 of a nanosecond, or specifying an inch in terms of meters (for example
+ 254/10000 meters - which <code class="computeroutput"><span class="identifier">ratio</span></code>
+ will reduce to 127/5000 meters).
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span> <span class="special">=</span> <span class="number">1</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">ratio</span><span class="special">;</span>
+
+ <span class="comment">// ratio arithmetic
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_add</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_subtract</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_multiply</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_divide</span><span class="special">;</span>
+
+ <span class="comment">// ratio comparison
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_equal</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_not_equal</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_less</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_less_equal</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater_equal</span><span class="special">;</span>
+
+ <span class="comment">// convenience SI typedefs
+</span> <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"> Class
+ Template <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio.construction_and_assignment">Construction
+ and assignment</a></span></dt></dl></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">ratio</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">num</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">den</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">den</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
+
+ <span class="identifier">ratio</span><span class="special">()</span> <span class="special">{}</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">_D2</span><span class="special">></span>
+ <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>&,</span>
+ <span class="keyword">typename</span> <span class="identifier">enable_if_c</span>
+ <span class="special"><</span>
+ <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">num</span> <span class="special">==</span> <span class="identifier">num</span> <span class="special">&&</span>
+ <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">den</span> <span class="special">==</span> <span class="identifier">den</span>
+ <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">_D2</span><span class="special">></span>
+ <span class="keyword">typename</span> <span class="identifier">enable_if_c</span>
+ <span class="special"><</span>
+ <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">num</span> <span class="special">==</span> <span class="identifier">num</span> <span class="special">&&</span>
+ <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">den</span> <span class="special">==</span> <span class="identifier">den</span><span class="special">,</span>
+ <span class="identifier">ratio</span><span class="special">&</span>
+ <span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>&)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ A diagnostic will be emitted if <code class="computeroutput"><span class="identifier">ratio</span></code>
+ is instantiated with <code class="computeroutput"><span class="identifier">D</span> <span class="special">==</span> <span class="number">0</span></code>, or
+ if the absolute value of <code class="computeroutput"><span class="identifier">N</span></code>
+ or <code class="computeroutput"><span class="identifier">D</span></code> can not be represented.
+ <span class="bold"><strong>Note:</strong></span> These rules ensure that infinite
+ ratios are avoided and that for any negative input, there exists a representable
+ value of its absolute value which is positive. In a two's complement
+ representation, this excludes the most negative value.
+ </p>
+<p>
+ Let <code class="computeroutput"><span class="identifier">gcd</span></code> denote the greatest
+ common divisor of <code class="computeroutput"><span class="identifier">N</span></code>'s
+ absolute value and of <code class="computeroutput"><span class="identifier">D</span></code>'s
+ absolute value.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">num</span></code> has the value
+ <code class="computeroutput"><span class="identifier">sign</span><span class="special">(</span><span class="identifier">N</span><span class="special">)*</span><span class="identifier">sign</span><span class="special">(</span><span class="identifier">D</span><span class="special">)*</span><span class="identifier">abs</span><span class="special">(</span><span class="identifier">N</span><span class="special">)/</span><span class="identifier">gcd</span></code>.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">den</span></code> has the value
+ <code class="computeroutput"><span class="identifier">abs</span><span class="special">(</span><span class="identifier">D</span><span class="special">)/</span><span class="identifier">gcd</span></code>.
+ </li>
+</ul></div>
+<p>
+ The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
+ denotes the normalized form of this ratio type. It should be used when
+ the template parameters don't give a normalized form.
+ </p>
+<p>
+ Two <code class="computeroutput"><span class="identifier">ratio</span></code> classes <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">></span></code>
+ and <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">></span></code>
+ have the same normalized form if <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">>::</span><span class="identifier">type</span></code>
+ is the same type as <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">>::</span><span class="identifier">type</span></code>
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio.construction_and_assignment"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio.construction_and_assignment" title="Construction
+ and assignment">Construction
+ and assignment</a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">D2</span><span class="special">></span>
+ <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Constructs a <code class="computeroutput"><span class="identifier">ratio</span></code> object.
+ </p>
+<p>
+ <span class="bold"><strong>Remarks:</strong></span> This constructor will not
+ participate in overload resolution unless <code class="computeroutput"><span class="identifier">r</span></code>
+ has the same normalized form as <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">D2</span><span class="special">></span>
+ <span class="identifier">ratio</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Assigns a <code class="computeroutput"><span class="identifier">ratio</span></code>
+ object.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> *this.
+ </p>
+<p>
+ <span class="bold"><strong>Remarks:</strong></span> This operator will not participate
+ in overload resolution unless <code class="computeroutput"><span class="identifier">r</span></code>
+ has the same normalized form as <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic" title="
+ ratio arithmetic">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a>
+</h5></div></div></div>
+<p>
+ For each of the class templates in this clause, each template parameter
+ refers to a <code class="computeroutput"><span class="identifier">ratio</span></code>. If
+ the implementation is unable to form the indicated <code class="computeroutput"><span class="identifier">ratio</span></code>
+ due to overflow, a diagnostic will be issued.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_add</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>
+ is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">+</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_subtract</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>
+ is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">-</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_multiply</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>
+ is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_divide</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>
+ is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</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">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_equal</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="special">></span> <span class="special">{};</span>
+</pre>
+<p>
+ If R1::num <code class="literal">= R2::num && R1::den =</code> R2::den,
+ ratio_equal derives from true_type, else derives from false_type.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">ratio_less</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="special">></span> <span class="special">{};</span>
+</pre>
+<p>
+ If R1::num * R2::den < R2::num * R1::den, ratio_less derives from
+ true_type, else derives from false_type. Implementations are permitted
+ to use more complex algorithms to compute the above relationship to avoid
+ overflow. If the implementation is not able to avoid overflow, a diagnostic
+ is emitted.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_not_equal</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">!</span><span class="identifier">ratio_equal</span><span class="special"><</span><span class="identifier">R1</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">>::</span><span class="identifier">value</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">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_less_equal</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">!</span><span class="identifier">ratio_less</span><span class="special"><</span><span class="identifier">R2</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">>::</span><span class="identifier">value</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">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="identifier">ratio_less</span><span class="special"><</span><span class="identifier">R2</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">>::</span><span class="identifier">value</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">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater_equal</span>
+ <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">!</span><span class="identifier">ratio_less</span><span class="special"><</span><span class="identifier">R1</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">></span> <span class="special">{};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs" title="
+ SI typedefs">
+ SI typedefs</a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="comment">// convenience SI typedefs
+</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
+</pre>
+<p>
+ Four of the typedefs in the recomendation which can be conditionally
+ supported are not supported: yocto, zepto, zetta and yotta.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">1000000000000000000000000</span><span class="special">></span> <span class="identifier">yocto</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">1000000000000000000000</span><span class="special">></span> <span class="identifier">zepto</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000000000</span><span class="special">,</span> <span class="number">1</span><span class="special">></span> <span class="identifier">zetta</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000000000</span><span class="special">,</span> <span class="number">1</span><span class="special">></span> <span class="identifier">yotta</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span></pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp"></a> Header <boost/chrono.hpp>
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Clock
Requirements</span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits">Time-related
+ traits</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_">Class
+ template <code class="computeroutput"><span class="identifier">duration</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic">duration
+ non-member arithmetic</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons">duration
+ comparaisons</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_cast">
+ Non-Member function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_">Class
+ template <code class="computeroutput"><span class="identifier">time_point</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic">time_point
+ non-member arithmetic</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons">time_point
+ comparisons</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_">Class
+ <code class="computeroutput"><span class="identifier">system_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__monotonic_clock_">Class
+ <code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__high_resolution_clock_">Class
+ <code class="computeroutput"><span class="identifier">high_resolution_clock</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">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span> <span class="special">=</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">duration</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">Duration</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">class</span> <span class="identifier">time_point</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">common_type</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">Rep1</span><span class="special">,</span> <span class="identifier">Period1</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">Rep2</span><span class="special">,</span> <span class="identifier">Period2</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span>
+ <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">>;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
+
+ <span class="comment">// customization traits
+</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">struct</span> <span class="identifier">treat_as_floating_point</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">struct</span> <span class="identifier">duration_values</span><span class="special">;</span>
+
+ <span class="comment">// duration arithmetic
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+ <span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</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">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+ <span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+ <span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</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">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="comment">// duration comparisons
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="comment">// duration_cast
+</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</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="identifier">ToDuration</span> <span class="identifier">duration_cast</span><span class="special">(</span><span class="keyword">const</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="comment">// convenience typedefs
+</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <span class="identifier">nanoseconds</span><span class="special">;</span> <span class="comment">// at least 64 bits needed
+</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span> <span class="comment">// at least 55 bits needed
+</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">milliseconds</span><span class="special">;</span> <span class="comment">// at least 45 bits needed
+</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span> <span class="comment">// at least 35 bits needed
+</span> <span class="keyword">typedef</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> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span> <span class="comment">// at least 29 bits needed
+</span> <span class="keyword">typedef</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> <span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">hours</span><span class="special">;</span> <span class="comment">// at least 23 bits needed
+</span>
+ <span class="comment">// time_point arithmetic
+</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</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">Duration2</span><span class="special">></span>
+ <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="comment">// time_point comparisons
+</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="comment">// time_point_cast
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</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">Duration</span><span class="special">></span>
+ <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <span class="identifier">time_point_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
+
+ <span class="comment">// Clocks
+</span> <span class="keyword">class</span> <span class="identifier">system_clock</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">monotonic_clock</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">high_resolution_clock</span><span class="special">;</span>
+
+<span class="special">}</span>
+<span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp._clock__requirements"></a>Clock
Requirements
+</h5></div></div></div>
+<p>
+ A clock represents a bundle consisting of a native <code class="computeroutput"><span class="identifier">duration</span></code>,
+ a native <code class="computeroutput"><span class="identifier">time_point</span></code>,
+ and a function <code class="computeroutput"><span class="identifier">now</span><span class="special">()</span></code>
+ to get the current <code class="computeroutput"><span class="identifier">time_point</span></code>.
+ A clock must meet the requirements in the following Table.
+ </p>
+<p>
+ In this table <code class="computeroutput"><span class="identifier">C1</span></code> and
+ <code class="computeroutput"><span class="identifier">C2</span></code> denote <code class="computeroutput"><span class="identifier">clock</span></code> types. <code class="computeroutput"><span class="identifier">t1</span></code>
+ and <code class="computeroutput"><span class="identifier">t2</span></code> are values returned
+ from <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>
+ where the call returning <code class="computeroutput"><span class="identifier">t1</span></code>
+ happens before the call returning <code class="computeroutput"><span class="identifier">t2</span></code>
+ and both of these calls happen before <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">::</span><span class="identifier">max</span><span class="special">()</span></code>.
+ </p>
+<div class="table">
+<a name="id4830558"></a><p class="title"><b>Table 1. Clock Requirements</b></p>
+<table class="table" summary="Clock 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">C1</span><span class="special">::</span><span class="identifier">rep</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ An arithmetic type or class emulating an arithmetic type.
+ </p>
+ </td>
+<td>
+ <p>
+ The representation type of the native <code class="computeroutput"><span class="identifier">duration</span></code>
+ and <code class="computeroutput"><span class="identifier">time_point</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">period</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">ratio</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The tick period of the clock in seconds.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">duration</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">C1</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+ <span class="identifier">C1</span><span class="special">::</span><span class="identifier">period</span><span class="special">></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The native <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">C1</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">C1</span><span class="special">></span>
+ <span class="keyword">or</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">C2</span><span class="special">,</span> <span class="identifier">C1</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The native <code class="computeroutput"><span class="identifier">time_point</span></code>
+ type of the <code class="computeroutput"><span class="identifier">clock</span></code>.
+ Different clocks are permitted to share a <code class="computeroutput"><span class="identifier">time_point</span></code>
+ definition if it is valid to compare their time_points by comparing
+ their respective <code class="computeroutput"><span class="identifier">duration</span></code>s.
+ <code class="computeroutput"><span class="identifier">C1</span></code> and <code class="computeroutput"><span class="identifier">C2</span></code> must refer to the same epoch.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">is_monotonic</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">const</span> <span class="keyword">bool</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="identifier">t1</span> <span class="special"><=</span>
+ <span class="identifier">t2</span></code> is always <code class="computeroutput"><span class="keyword">true</span></code>, else <code class="computeroutput"><span class="keyword">false</span></code>.
+ <span class="bold"><strong>Note: A <code class="computeroutput"><span class="identifier">clock</span></code>
+ that can be adjusted backwards is not monotonic</strong></span>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Returns a <code class="computeroutput"><span class="identifier">time_point</span></code>
+ representing the current point in time.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits" title="Time-related
+ traits">Time-related
+ traits</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.treat_as_floating_point">
+ Metafunction <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values">
+ Class template <code class="computeroutput"><span class="identifier">duration_values</span></code></a></span></dt>
+<dt><span class="section">common_type
specializations</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.treat_as_floating_point"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.treat_as_floating_point" title="
+ Metafunction treat_as_floating_point<>">
+ Metafunction <code class="computeroutput"><span class="identifier">treat_as_floating_point</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">Rep</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">treat_as_floating_point</span>
+ <span class="special">:</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_floating_point</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="special">{};</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">duration</span></code> template
+ uses the <code class="computeroutput"><span class="identifier">treat_as_floating_point</span></code>
+ trait to help determine if a <code class="computeroutput"><span class="identifier">duration</span></code>
+ with one tick period can be converted to another <code class="computeroutput"><span class="identifier">duration</span></code>
+ with a different tick period. If <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>::</span><span class="identifier">value</span></code>
+ is <code class="computeroutput"><span class="keyword">true</span></code>, then <code class="computeroutput"><span class="identifier">Rep</span></code> is a floating point type and
+ implicit conversions are allowed among <code class="computeroutput"><span class="identifier">duration</span></code>s.
+ Otherwise, the implicit convertibility depends on the tick periods
+ of the <code class="computeroutput"><span class="identifier">duration</span></code>s. If
+ <code class="computeroutput"><span class="identifier">Rep</span></code> is a class type
+ which emulates a floating point type, the author of <code class="computeroutput"><span class="identifier">Rep</span></code>
+ can specialize <code class="computeroutput"><span class="identifier">treat_as_floating_point</span></code>
+ so that <code class="computeroutput"><span class="identifier">duration</span></code> will
+ treat this <code class="computeroutput"><span class="identifier">Rep</span></code> as if
+ it were a floating point type. Otherwise <code class="computeroutput"><span class="identifier">Rep</span></code>
+ is assumed to be an integral type, or a class emulating an integral
+ type.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values" title="
+ Class template duration_values">
+ Class template <code class="computeroutput"><span class="identifier">duration_values</span></code></a>
+</h6></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.zero">
+ Static member function<code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.max">
+ Static member function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.min">
+ Static member function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><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">struct</span> <span class="identifier">duration_values</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">Rep</span> <span class="identifier">zero</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">Rep</span> <span class="identifier">max</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">Rep</span> <span class="identifier">min</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">duration</span></code> template
+ uses the <code class="computeroutput"><span class="identifier">duration_values</span></code>
+ trait to construct special values of the <code class="computeroutput"><span class="identifier">duration</span></code>s
+ representation (<code class="computeroutput"><span class="identifier">Rep</span></code>).
+ This is done because the representation might be a class type with
+ behavior which requires some other implementation to return these special
+ values. In that case, the author of that class type should specialize
+ <code class="computeroutput"><span class="identifier">duration_values</span></code> to
+ return the indicated values.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.zero"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.zero" title="
+ Static member functionzero()">
+ Static member function<code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">Rep</span> <span class="identifier">zero</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">Rep</span><span class="special">(</span><span class="number">0</span><span class="special">)</span></code>. <span class="bold"><strong>Note:</strong></span>
+ <code class="computeroutput"><span class="identifier">Rep</span><span class="special">(</span><span class="number">0</span><span class="special">)</span></code>
+ is specified instead of <code class="computeroutput"><span class="identifier">Rep</span><span class="special">()</span></code> since <code class="computeroutput"><span class="identifier">Rep</span><span class="special">()</span></code> may have some other meaning, such
+ as an uninitialized value.
+ </p>
+<p>
+ <span class="bold"><strong>Remarks:</strong></span> The value returned corresponds
+ to the additive identity.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.max"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.max" title="
+ Static member function max()">
+ Static member function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">Rep</span> <span class="identifier">max</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>::</span><span class="identifier">max</span><span class="special">()</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Remarks:</strong></span> The value returned compares
+ greater than zero().
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.min"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits.duration_values.min" title="
+ Static member function min()">
+ Static member function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">Rep</span> <span class="identifier">min</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>::</span><span class="identifier">lowest</span><span class="special">()</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Remarks:</strong></span> The value returned compares
+ less than or equal to <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_related_traits._common_type__specializations"></a>common_type
specializations
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">common_type</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">Rep1</span><span class="special">,</span> <span class="identifier">Period1</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">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">></span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</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 period of the <code class="computeroutput"><span class="identifier">duration</span></code>
+ indicated by this specialization of <code class="computeroutput"><span class="identifier">common_type</span></code>
+ is the greatest common divisor of <code class="computeroutput"><span class="identifier">Period1</span></code>
+ and <code class="computeroutput"><span class="identifier">Period2</span></code>. This can
+ be computed by forming a <code class="computeroutput"><span class="identifier">ratio</span></code>
+ of the greatest common divisor of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">num</span></code>
+ and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">num</span></code>, and the least common multiple
+ of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">den</span></code> and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">den</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Note:</strong></span> The typedef type is the <code class="computeroutput"><span class="identifier">duration</span></code> with the largest tick period
+ possible where both <code class="computeroutput"><span class="identifier">duration</span></code>
+ arguments will convert to it without requiring a division operation.
+ The representation of this type is intended to be able to hold any
+ value resulting from this conversion, with the possible exception of
+ round-off error when floating point <code class="computeroutput"><span class="identifier">duration</span></code>s
+ are involved (but not truncation error).
+ </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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">></span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">common_type</span></code> of
+ two <code class="computeroutput"><span class="identifier">time_point</span></code>s is
+ a <code class="computeroutput"><span class="identifier">time_point</span></code> with the
+ same <code class="computeroutput"><span class="identifier">clock</span></code> (both have
+ the same <code class="computeroutput"><span class="identifier">clock</span></code>), and
+ the <code class="computeroutput"><span class="identifier">common_type</span></code> of
+ the two <code class="computeroutput"><span class="identifier">duration</span></code>s.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_" title="Class
+ template duration">Class
+ template <code class="computeroutput"><span class="identifier">duration</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_c_1">
+ Constructor <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_c_2">
+ Constructor <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.count">
+ Member function <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_p">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_m">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pp">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pp2">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_mm">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_mm2">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pa">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_ma">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_moda">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_proda">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_da">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_moda_2">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_zero">
+ Static Member function <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_min">
+ Static Member function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_max">
+ Static Member function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<p>
+ A <code class="computeroutput"><span class="identifier">duration</span></code> measures time
+ between two points in time (<code class="computeroutput"><span class="identifier">time_point</span></code>).
+ A <code class="computeroutput"><span class="identifier">duration</span></code> has a representation
+ which holds a count of ticks, and a tick period. The tick period is the
+ amount of time which occurs from one tick to another in units of a second.
+ It is expressed as a rational constant using <code class="computeroutput"><span class="identifier">ratio</span></code>.
+ </p>
+<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">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">class</span> <span class="identifier">duration</span> <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">Rep</span> <span class="identifier">rep</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">Period</span> <span class="identifier">period</span><span class="special">;</span>
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">rep</span> <span class="identifier">rep_</span><span class="special">;</span> <span class="comment">// exposition only
+</span> <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">()</span> <span class="special">{}</span> <span class="comment">// = default;
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+ <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">r</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if_c</span>
+ <span class="special"><</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
+ <span class="special">&&</span> <span class="special">(</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
+ <span class="special">||</span> <span class="special">(!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
+ <span class="special">&&</span> <span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">))</span>
+ <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+ <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if_c</span>
+ <span class="special"><</span>
+ <span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
+ <span class="special">||</span> <span class="special">(</span><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period2</span><span class="special">,</span> <span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span><span class="special">::</span><span class="identifier">den</span> <span class="special">==</span> <span class="number">1</span>
+ <span class="special">&&</span> <span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">)</span>
+ <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+
+ <span class="comment">//~duration() = default;
+</span> <span class="comment">//duration(const duration&) = default;
+</span> <span class="comment">//duration& operator=(const duration&) = default;
+</span>
+ <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">rep</span> <span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+();</span>
+ <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-();</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">++();</span>
+ <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">);</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">--();</span>
+ <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">);</span>
+
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="identifier">zero</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="identifier">min</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="identifier">max</span><span class="special">();</span>
+ <span class="special">};</span>
+
+<span class="special">}}</span>
+</pre>
+<p>
+ Rep must be an arithmetic type, or a class emulating an arithmetic type.
+ If <code class="computeroutput"><span class="identifier">duration</span></code> is instantiated
+ with the type of <code class="computeroutput"><span class="identifier">Rep</span></code>
+ being a <code class="computeroutput"><span class="identifier">duration</span></code>, a diagnostic
+ is required.
+ </p>
+<p>
+ Period must be an instantiation of <code class="computeroutput"><span class="identifier">ratio</span></code>,
+ compile diagnostic otherwise.
+ </p>
+<p>
+ Period::num must be positive, compile diagnostic otherwise.
+ </p>
+<p>
+ Examples:
+ </p>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">holds</span> <span class="identifier">a</span> <span class="identifier">count</span> <span class="identifier">of</span> <span class="identifier">minutes</span> <span class="keyword">using</span> <span class="identifier">a</span> <span class="keyword">long</span><span class="special">.</span>
+
+<span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">holds</span> <span class="identifier">a</span> <span class="identifier">count</span> <span class="identifier">of</span> <span class="identifier">milliseconds</span> <span class="keyword">using</span> <span class="identifier">a</span> <span class="keyword">long</span> <span class="keyword">long</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">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">30</span><span class="special">></span> <span class="special">></span> <span class="identifier">holds</span> <span class="identifier">a</span> <span class="identifier">count</span> <span class="keyword">using</span> <span class="identifier">a</span> <span class="keyword">double</span> <span class="identifier">with</span> <span class="identifier">a</span> <span class="identifier">tick</span> <span class="identifier">period</span> <span class="identifier">of</span> <span class="number">1</span><span class="special">/</span><span class="number">30</span> <span class="identifier">second</span> <span class="special">(</span><span class="identifier">a</span> <span class="identifier">tick</span> <span class="identifier">fre
quency</span> <span class="identifier">of</span> <span class="number">30</span> <span class="identifier">Hz</span><span class="special">).</span>
+</pre>
+<p>
+ The following members of <code class="computeroutput"><span class="identifier">duration</span></code>
+ do not throw an exception unless the indicated operations on the representations
+ throw an exception.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_c_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_c_1" title="
+ Constructor duration(const Rep2&)">
+ Constructor <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</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">Rep2</span><span class="special">></span>
+<span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">r</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> <code class="computeroutput"><span class="identifier">Rep2</span></code>
+ is implicitly convertible to <code class="computeroutput"><span class="identifier">rep</span></code>,
+ and
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span></code>
+ is <code class="computeroutput"><span class="keyword">true</span></code>, or
+ </li>
+<li>
+<code class="computeroutput"><span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
+ <span class="special">&&</span> <span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">value</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>.
+ </li>
+</ul></div>
+<p>
+ A diagnostic is required if this requirement is not met. <span class="bold"><strong>Note:</strong></span> This requirement prevents construction
+ of an integral-based <code class="computeroutput"><span class="identifier">duration</span></code>
+ with a floating point representation. Such a construction could easily
+ lead to confusion about the value of the <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Example:</strong></span>
+ </p>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3.5</span><span class="special">);</span> <span class="comment">// do not compile
+</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// ok
+</span></pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Constructs an object of type
+ <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>PostConditions:</strong></span> <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>(</span><span class="identifier">r</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_c_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_c_2" title="
+ Constructor duration(const duration&)">
+ Constructor <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</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">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span></code>,
+ or <code class="computeroutput"><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period2</span><span class="special">,</span>
+ <span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span><span class="special">::</span><span class="identifier">den</span> <span class="special">==</span>
+ <span class="number">1</span></code>.
+ </p>
+<pre class="programlisting"><span class="identifier">A</span> <span class="identifier">diagnostic</span> <span class="identifier">is</span> <span class="identifier">required</span> <span class="keyword">if</span> <span class="keyword">this</span> <span class="identifier">requirement</span> <span class="identifier">is</span> <span class="keyword">not</span> <span class="identifier">met</span><span class="special">.</span>
+</pre>
+<p>
+ <span class="bold"><strong>note</strong></span> This requirement prevents implicit
+ truncation error when converting between integral-based <code class="computeroutput"><span class="identifier">duration</span></code>s. Such a construction could
+ easily lead to confusion about the value of the <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Example:</strong></span>
+ </p>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
+<span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">ms</span><span class="special">;</span> <span class="comment">// ok
+</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms2</span> <span class="special">=</span> <span class="identifier">us</span><span class="special">;</span> <span class="comment">// do not compile
+</span></pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Constructs an object of type
+ <code class="computeroutput"><span class="identifier">duration</span></code>, constructing
+ <code class="computeroutput"><span class="identifier">rep_</span></code> from <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">duration</span><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.count"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.count" title="
+ Member function count() const">
+ Member function <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">rep</span> <span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> `rep_v.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_p"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_p" title="
+ Member function operator+() const">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_m"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_m" title="
+ Member function operator+() const">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(-</span><span class="identifier">rep_</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pp"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pp" title="
+ Member function operator++()">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">++();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">++</span><span class="identifier">rep_</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pp2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pp2" title="
+ Member function operator++(int)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> `duration(rep_++)v.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_mm"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_mm" title="
+ Member function operator++()">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">--();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">--</span><span class="identifier">rep_</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_mm2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_mm2" title="
+ Member function operator++(int)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">--)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pa"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_pa" title="
+ Member function operator+=(const duration&)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
+ <span class="special">+=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_ma"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_ma" title="
+ Member function operator-=(const duration&)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
+ <span class="special">-=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_moda"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_moda" title="
+ Member function operator%=(const duration&)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
+ <span class="special">%=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_proda"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_proda" title="
+ Member function operator*=(const rep&)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
+ <span class="special">*=</span> <span class="identifier">rhs</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_da"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_da" title="
+ Member function operator/=(const rep&)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
+ <span class="special">/=</span> <span class="identifier">rhs</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_moda_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_operator_moda_2" title="
+ Member function operator%=(const rep&)">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
+ <span class="special">%=</span> <span class="identifier">rhs</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_zero"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_zero" title="
+ Static Member function zero()">
+ Static Member function <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">duration</span> <span class="identifier">zero</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">zero</span><span class="special">())</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_min"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_min" title="
+ Static Member function min()">
+ Static Member function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">duration</span> <span class="identifier">min</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">min</span><span class="special">()).</span></code>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_max"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__duration_.duration_max" title="
+ Static Member function max()">
+ Static Member function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">constexpr</span> <span class="identifier">duration</span> <span class="identifier">max</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">max</span><span class="special">())</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic" title="duration
+ non-member arithmetic">duration
+ non-member arithmetic</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_p_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_m_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_prod_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_d_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_d_2">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_p_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_p_1" title="
+ Non-Member function operator+(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">rhs</span></code> where <code class="computeroutput"><span class="identifier">CD</span></code>
+ is the type of the return value.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_m_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_m_1" title="
+ Non-Member function operator-(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">)</span> <span class="special">-=</span> <span class="identifier">rhs</span></code> where <code class="computeroutput"><span class="identifier">CD</span></code>
+ is the type of the return value.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</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">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
+ represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
+ in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
+ and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
+ convertible to <code class="computeroutput"><span class="identifier">CR</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="identifier">CR</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> <span class="identifier">s</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_prod_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_prod_1" title="
+ Non-Member function operator*(Rep1,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
+ represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
+ in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
+ and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
+ convertible to <code class="computeroutput"><span class="identifier">CR</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">d</span>
+ <span class="special">*</span> <span class="identifier">s</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_d_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_d_1" title="
+ Non-Member function operator/(duration,Rep2)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
+<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</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">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
+ represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
+ in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
+ and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
+ convertible to <code class="computeroutput"><span class="identifier">CR</span></code>,
+ and <code class="computeroutput"><span class="identifier">Rep2</span></code> is not an
+ instantiation of <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="identifier">CR</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> <span class="identifier">s</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_d_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_non_member_arithmetic.duration_operator_d_2" title="
+ Non-Member function operator/(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
+ represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ of the two <code class="computeroutput"><span class="identifier">duration</span></code>
+ arguments. Returns <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">/</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons" title="duration
+ comparaisons">duration
+ comparaisons</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_eq_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_neq_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_lt_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_leq_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_gt_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_gteq_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_eq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_eq_1" title="
+ Non-Member function operator==(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
+ represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ of the two <code class="computeroutput"><span class="identifier">duration</span></code>
+ arguments. Returns <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_neq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_neq_1" title="
+ Non-Member function operator!=(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special">==</span>
+ <span class="identifier">rhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_lt_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_lt_1" title="
+ Non-Member function operator<(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
+ represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
+ of the two <code class="computeroutput"><span class="identifier">duration</span></code>
+ arguments. Returns <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_leq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_leq_1" title="
+ Non-Member function operator<=(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">rhs</span> <span class="special"><</span>
+ <span class="identifier">lhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_gt_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_gt_1" title="
+ Non-Member function operator>(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
+ <span class="special"><</span> <span class="identifier">lhs</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_gteq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_comparaisons.duration_operator_gteq_1" title="
+ Non-Member function operator>=(duration,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special"><</span>
+ <span class="identifier">rhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.duration_cast"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)">
+ Non-Member function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</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">ToDuration</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="identifier">ToDuration</span> <span class="identifier">duration_cast</span><span class="special">(</span><span class="keyword">const</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>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> This function will not participate
+ in overload resolution unless <code class="computeroutput"><span class="identifier">ToDuration</span></code>
+ is an instantiation of <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> Forms <code class="computeroutput"><span class="identifier">CF</span></code>
+ which is a <code class="computeroutput"><span class="identifier">ratio</span></code> resulting
+ from <code class="computeroutput"><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ Let <code class="computeroutput"><span class="identifier">CR</span></code> be the <code class="computeroutput"><span class="identifier">common_type</span></code> of <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span></code>,
+ <code class="computeroutput"><span class="identifier">Rep</span></code>, and <code class="computeroutput"><span class="identifier">intmax_t</span></code>.
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ If <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span> <span class="special">==</span>
+ <span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span> <span class="special">==</span> <span class="number">1</span></code>,
+ then returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
+ <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()))</span>
+ </code>
+</li>
+<li>
+ else if <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span> <span class="special">!=</span>
+ <span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span> <span class="special">==</span> <span class="number">1</span></code>,
+ then returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
+ <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">())</span>
+ <span class="special">*</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span><span class="special">)))</span></code>
+</li>
+<li>
+ else if <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span> <span class="special">==</span>
+ <span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span> <span class="special">!=</span> <span class="number">1</span></code>,
+ then returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
+ <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">())</span>
+ <span class="special">/</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span><span class="special">)))</span></code>
+</li>
+<li>
+ else returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
+ <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">())</span>
+ <span class="special">*</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span><span class="special">)</span> <span class="special">/</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span><span class="special">)))</span></code>
+</li>
+</ul></div>
+<p>
+ <span class="bold"><strong>Remarks:</strong></span> This function does not rely
+ on any implicit conversions. All conversions must be accomplished through
+ <code class="computeroutput"><span class="keyword">static_cast</span></code>. The implementation
+ avoids all multiplications or divisions when it is known at compile time
+ that it can be avoided because one or more arguments are <code class="computeroutput"><span class="number">1</span></code>. All intermediate computations are carried
+ out in the widest possible representation and only converted to the destination
+ representation at the final step.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_" title="Class
+ template time_point">Class
+ template <code class="computeroutput"><span class="identifier">time_point</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_1">
+ Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_2">
+ Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_3">
+ Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_since_epoch">
+ Member function <code class="computeroutput"><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="keyword">const</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_operator_pe">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_operator_me">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_min">
+ Static Member function <code class="computeroutput"><span class="identifier">min</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_max">
+ Static Member function <code class="computeroutput"><span class="identifier">max</span></code></a></span></dt>
+</dl></div>
+<p>
+ A <code class="computeroutput"><span class="identifier">time_point</span></code> represents
+ a point in time with respect to a specific clock.
+ </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">Duration</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">time_point</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">Duration</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">duration</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">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">duration</span> <span class="identifier">d_</span><span class="special">;</span> <span class="comment">// exposition only
+</span><span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">time_point</span><span class="special">();</span>
+ <span class="keyword">explicit</span> <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="comment">// conversions
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+ <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if</span>
+ <span class="special"><</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special"><</span><span class="identifier">Duration2</span><span class="special">,</span> <span class="identifier">duration</span><span class="special">></span>
+ <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+
+ <span class="comment">// observer
+</span>
+ <span class="identifier">duration</span> <span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="comment">// arithmetic
+</span>
+ <span class="identifier">time_point</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">time_point</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+
+ <span class="comment">// special values
+</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">time_point</span> <span class="identifier">min</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">time_point</span> <span class="identifier">max</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ Clock must meet the Clock Requirements.
+ </p>
+<p>
+ Duration must be an instantiation of <code class="computeroutput"><span class="identifier">duration</span></code>,
+ compile diagnostic otherwise.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_1" title="
+ Constructor time_point()">
+ Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Constructs an object of
+ <code class="computeroutput"><span class="identifier">time_point</span></code>, initializing
+ <code class="computeroutput"><span class="identifier">d_</span></code> with <code class="computeroutput"><span class="identifier">duration</span><span class="special">::</span><span class="identifier">zero</span><span class="special">()</span></code>.
+ This <code class="computeroutput"><span class="identifier">time_point</span></code> represents
+ the epoch.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_2" title="
+ Constructor time_point(const duration&)">
+ Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Constructs an object of
+ <code class="computeroutput"><span class="identifier">time_point</span></code>, initializing
+ <code class="computeroutput"><span class="identifier">d_</span></code> with <code class="computeroutput"><span class="identifier">d</span></code>. This <code class="computeroutput"><span class="identifier">time_point</span></code>
+ represents the epoch <code class="computeroutput"><span class="special">+</span> <span class="identifier">d</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_3"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_c_3" title="
+ Constructor time_point(const duration&)">
+ Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</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">Duration2</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> This function will not participate
+ in overload resolution unless <code class="computeroutput"><span class="identifier">Duration2</span></code>
+ is implicitly convertible to <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> Constructs an object of
+ <code class="computeroutput"><span class="identifier">time_point</span></code>, initializing
+ <code class="computeroutput"><span class="identifier">d_</span></code> with <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_since_epoch"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_since_epoch" title="
+ Member function time_since_epoch() const">
+ Member function <code class="computeroutput"><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="keyword">const</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">duration</span> <span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">d_</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_operator_pe"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_operator_pe" title="
+ Member function operator+=">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">d_</span>
+ <span class="special">+=</span> <span class="identifier">d</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_operator_me"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_operator_me" title="
+ Member function operator-=">
+ Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">d_</span>
+ <span class="special">-=</span> <span class="identifier">d</span></code>
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_min"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_min" title="
+ Static Member function min">
+ Static Member function <code class="computeroutput"><span class="identifier">min</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">time_point</span> <span class="identifier">min</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">min</span><span class="special">())</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_max"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class_template__time_point_.time_point_max" title="
+ Static Member function max">
+ Static Member function <code class="computeroutput"><span class="identifier">max</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">time_point</span> <span class="identifier">max</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">max</span><span class="special">())</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic" title="time_point
+ non-member arithmetic">time_point
+ non-member arithmetic</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_2">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_1">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_2">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_1" title="
+ Non-Member function operator+(time_point,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CT</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">rhs</span></code> where <code class="computeroutput"><span class="identifier">CT</span></code>
+ is the type of the return value.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_2" title="
+ Non-Member function operator+(duration,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</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">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</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">Duration2</span><span class="special">></span>
+<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
+ <span class="special">+</span> <span class="identifier">lhs</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_1" title="
+ Non-Member function operator-(time_point,duration)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
+<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span>
+ <span class="special">+</span> <span class="special">(-</span><span class="identifier">rhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_2" title="
+ Non-Member function operator-(duration,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons" title="time_point
+ comparisons">time_point
+ comparisons</a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_eq">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_neq">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_lt">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_leq">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_gt">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_geq">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_cast">
+ Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_eq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_eq" title="
+ Non-Member function operator==(time_point,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_neq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_neq" title="
+ Non-Member function operator!=(time_point,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
+</h6></div></div></div>
+<p>
+ template <class Clock, class Duration1, class Duration2> bool
+ operator!=(const time_point<Clock, Duration1>& lhs, const
+ time_point<Clock, Duration2>& rhs);
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special">==</span>
+ <span class="identifier">rhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_lt"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_lt" title="
+ Non-Member function operator<(time_point,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> lhs.time_since_epoch() <
+ rhs.time_since_epoch().
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_leq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_leq" title="
+ Non-Member function operator<=(time_point,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">rhs</span> <span class="special"><</span>
+ <span class="identifier">lhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_gt"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_gt" title="
+ Non-Member function operator>(time_point,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
+</h6></div></div></div>
+<p>
+ template <class Clock, class Duration1, class Duration2> bool
+ operator> (const time_point<Clock, Duration1>& lhs, const
+ time_point<Clock, Duration2>& rhs);
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
+ <span class="special"><</span> <span class="identifier">lhs</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_geq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_operator_geq" title="
+ Non-Member function operator>=(time_point,time_point)">
+ Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</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">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special"><</span>
+ <span class="identifier">rhs</span><span class="special">)</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_cast"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.time_point_comparisons.time_point_cast" title="
+ Non-Member function time_point_cast(time_point)">
+ Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</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">ToDuration</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">Duration</span><span class="special">></span>
+<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <span class="identifier">time_point_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Requires:</strong></span> This function will not participate
+ in overload resolution unless <code class="computeroutput"><span class="identifier">ToDuration</span></code>
+ is an instantiation of <code class="computeroutput"><span class="identifier">duration</span></code>.
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()))</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_" title="Class
+ system_clock">Class
+ <code class="computeroutput"><span class="identifier">system_clock</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_.to_time_t">
+ Static member function <code class="computeroutput"><span class="identifier">to_time_t</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_.from_time_t">
+ Static member function <code class="computeroutput"><span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_t</span><span class="special">)</span></code></a></span></dt>
+</dl></div>
+<p>
+ The <code class="computeroutput"><span class="identifier">system_clock</span></code> class
+ provides a means of obtaining the current wall-clock time from the system-wide
+ real-time clock. The current time can be obtained by calling <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
+ Instances of <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span></code>
+ can be converted to and from time_t with the <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">to_time_t</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">to_time_point</span><span class="special">()</span></code> functions. If system clock is not monotonic,
+ a subsequent call to <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code> may return an earlier time than a previous
+ call (e.g. if the operating system clock is manually adjusted, or synchronized
+ with an external clock).
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">system_clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">BOOST_SYSTEM_CLOCK_DURATION</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</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_monotonic</span> <span class="special">=</span> <span class="keyword">false</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="comment">// throws on error
+</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="comment">// never throws
+</span>
+ <span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">to_time_t</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special">&</span> <span class="identifier">t</span><span class="special">);</span>
+ <span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">t</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ <code class="computeroutput"><span class="identifier">system_clock</span></code> satisfy
+ the Clock Requirements. In addition:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+<code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">min</span><span class="special">()</span> <span class="special"><</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">zero</span><span class="special">()</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>.
+ </li></ul></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_.to_time_t"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_.to_time_t" title="
+ Static member function to_time_t(time_point)">
+ Static member function <code class="computeroutput"><span class="identifier">to_time_t</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
+</h6></div></div></div>
+<p>
+ time_t to_time_t(const time_point& t);
+ </p>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> A <code class="computeroutput"><span class="identifier">time_t</span></code>
+ such that the <code class="computeroutput"><span class="identifier">time_t</span></code>
+ and <code class="computeroutput"><span class="identifier">t</span></code> represent the
+ same point in time, truncated to the courser of the precisions among
+ <code class="computeroutput"><span class="identifier">time_t</span></code> and <code class="computeroutput"><span class="identifier">t</span></code>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_.from_time_t"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__system_clock_.from_time_t" title="
+ Static member function from_time_t(time_t)">
+ Static member function <code class="computeroutput"><span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_t</span><span class="special">)</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">time_point</span> <span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_t</span> <span class="identifier">t</span><span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> A <code class="computeroutput"><span class="identifier">time_point</span></code>
+ such that the <code class="computeroutput"><span class="identifier">time_point</span></code>
+ and <code class="computeroutput"><span class="identifier">t</span></code> represent the
+ same point in time, truncated to the courser of the precisions among
+ <code class="computeroutput"><span class="identifier">time_point</span></code> and <code class="computeroutput"><span class="identifier">t</span></code>.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class__monotonic_clock_"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__monotonic_clock_" title="Class
+ monotonic_clock">Class
+ <code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">monotonic_clock</span></code> satisfy
+ the Clock Requirements.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">monotonic_clock</span></code> class
+ provides access to the system-wide monotonic clock. The current time
+ can be obtained by calling <code class="computeroutput"><span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>. There is no fixed relationship between
+ values returned by <code class="computeroutput"><span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code> and wall-clock time.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_HAS_CLOCK_MONOTONIC</span>
+ <span class="keyword">class</span> <span class="identifier">BOOST_CHRONO_DECL</span> <span class="identifier">monotonic_clock</span> <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">monotonic_clock</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_monotonic</span> <span class="special">=</span> <span class="keyword">true</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="comment">// throws on error
+</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="comment">// never throws
+</span> <span class="special">};</span>
+<span class="preprocessor">#endif</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_hpp.class__high_resolution_clock_"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_hpp.class__high_resolution_clock_" title="Class
+ high_resolution_clock">Class
+ <code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">high_resolution_clock</span></code>
+ satisfy the Clock Requirements.
+ </p>
+<pre class="programlisting"><span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="keyword">typedef</span> <span class="identifier">monotonic_clock</span> <span class="identifier">high_resolution_clock</span><span class="special">;</span> <span class="comment">// as permitted by [time.clock.hires]
+</span><span class="preprocessor">#else</span>
+ <span class="keyword">typedef</span> <span class="identifier">system_clock</span> <span class="identifier">high_resolution_clock</span><span class="special">;</span> <span class="comment">// as permitted by [time.clock.hires]
+</span><span class="preprocessor">#endif</span>
+</pre>
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="process_cpu_related.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated_headers.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated_headers.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,352 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Deprecated
+ Headers</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../reference.html" title=" Reference ">
+<link rel="prev" href="stopwatch_reporters.html" title="Stopwatch
+ Reporters">
+<link rel="next" href="../examples.html" title="Examples">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="stopwatch_reporters.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../examples.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.reference.deprecated_headers"></a><a href="deprecated_headers.html" title="Deprecated
+ Headers">Deprecated
+ Headers</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.timer_hpp">
+ Deprecated 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">timer</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="deprecated_headers.html#boost_chrono.reference.deprecated_headers.timer_hpp.template_class__timer___">Template
+ Class <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">timer
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp">
+ Deprecated 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">process_times</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="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.typedef__process_times_">Typedef
+ <code class="computeroutput"><span class="identifier">process_times</span></code></a></span></dt>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_timer_">Class
+ <code class="computeroutput"><span class="identifier">process_timer</span></code></a></span></dt>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__run_timer_">Class
+ <code class="computeroutput"><span class="identifier">run_timer</span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.deprecated_headers.timer_hpp"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.timer_hpp" title="
+ Deprecated Header <boost/chrono/timer.hpp>">
+ Deprecated 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">timer</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="deprecated_headers.html#boost_chrono.reference.deprecated_headers.timer_hpp.template_class__timer___">Template
+ Class <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">timer
useful typedefs</span></dt>
+</dl></div>
+<p>
+ This header has been replaced by the header <boost/chrono/stopwatch.hpp>.
+ </p>
+<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> <span class="identifier">timer</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_timer</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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">monotonic_timer</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_timer</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.deprecated_headers.timer_hpp.template_class__timer___"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.timer_hpp.template_class__timer___" title="Template
+ Class timer<>">Template
+ Class <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code></a>
+</h5></div></div></div>
+<p>
+ Knowing how long a part of a program takes to execute is useful in both
+ test and production environments. A <code class="computeroutput"><span class="identifier">timer</span></code>
+ 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 coudl 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">timer</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">explicit</span> <span class="identifier">timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">timer</span><span class="special">();</span>
+
+ <span class="keyword">void</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.deprecated_headers.timer_hpp._timer__useful_typedefs"></a>timer
useful typedefs
+</h5></div></div></div>
+<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">timer</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_timer</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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">timer</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">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_timer</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">timer</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_timer</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.deprecated_headers.process_times_hpp"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp" title="
+ Deprecated Header <boost/chrono/process_times.hpp>">
+ Deprecated 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">process_times</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="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.typedef__process_times_">Typedef
+ <code class="computeroutput"><span class="identifier">process_times</span></code></a></span></dt>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_timer_">Class
+ <code class="computeroutput"><span class="identifier">process_timer</span></code></a></span></dt>
+<dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__run_timer_">Class
+ <code class="computeroutput"><span class="identifier">run_timer</span></code></a></span></dt>
+</dl></div>
+<p>
+ This header has been deprecated. See the <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">process_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>,
+ <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">process_stopwatches</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> and <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">process_stopwatches_reporter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
+ files.
+ </p>
+<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">process_clock</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">process_times</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">process_timer</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">run_timer</span><span class="special">;</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_" title="Class
+ process_clock">Class
+ <code class="computeroutput"><span class="identifier">process_clock</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_.class__process_times_">Class
+ <code class="computeroutput"><span class="identifier">process_times</span></code></a></span></dt></dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">process_clock</span></code> doesn't
+ satisfy the Clock Requirements as the function now do not follows the
+ Clock prototype.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_clock</span></code> provides
+ a thin wrapper around the operating system's process timer API. For POSIX-like
+ systems, that's the times() function, while for Windows, it's the GetProcessTimes()
+ function.
+ </p>
+<p>
+ The process relative real, user and system current time can be obtained
+ at once by calling <code class="computeroutput"><span class="identifier">process_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_clock</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_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
+
+ <span class="keyword">struct</span> <span class="identifier">process_times</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">process_times</span> <span class="special">&</span> <span class="identifier">times</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_.class__process_times_"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_clock_.class__process_times_" title="Class
+ process_times">Class
+ <code class="computeroutput"><span class="identifier">process_times</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">process_times</span> <span class="special">{</span>
+ <span class="identifier">process_clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">real</span><span class="special">;</span> <span class="comment">// real (i.e wall clock) time
+</span> <span class="identifier">process_clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">user</span><span class="special">;</span> <span class="comment">// user cpu time
+</span> <span class="identifier">process_clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">system</span><span class="special">;</span> <span class="comment">// system cpu time
+</span><span class="special">};</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.deprecated_headers.process_times_hpp.typedef__process_times_"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.typedef__process_times_" title="Typedef
+ process_times">Typedef
+ <code class="computeroutput"><span class="identifier">process_times</span></code></a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">process_clock</span><span class="special">::</span><span class="identifier">process_times</span> <span class="identifier">process_times</span><span class="special">;</span>
+</pre>
+<p>
+ This is a synonym of process_clock::process_times included for backward
+ compatibility.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_timer_"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__process_timer_" title="Class
+ process_timer">Class
+ <code class="computeroutput"><span class="identifier">process_timer</span></code></a>
+</h5></div></div></div>
+<p>
+ Knowing how long a program takes to execute is useful in both test and
+ production environments. It is also helpful if such timing information
+ is broken down into real (wall clock) time, CPU time spent by the user,
+ and CPU time spent by the operating system servicing user requests.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_timer</span><span class="special"><></span></code>
+ is the <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code>
+ equivalent associated to the pseudo-clock <code class="computeroutput"><span class="identifier">process_clock</span></code>.
+ It behaves like <code class="computeroutput"><span class="identifier">timer</span><span class="special"><></span></code> but it uses the specific <code class="computeroutput"><span class="identifier">process_clock</span><span class="special">:</span><span class="identifier">now</span><span class="special">()</span></code>
+ function.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_timer</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">process_clock</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">process_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="identifier">process_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">explicit</span> <span class="identifier">process_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">process_timer</span><span class="special">();</span>
+ <span class="keyword">void</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">elapsed</span><span class="special">(</span> <span class="identifier">process_times</span> <span class="special">&</span> <span class="identifier">times</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.deprecated_headers.process_times_hpp.class__run_timer_"></a><a href="deprecated_headers.html#boost_chrono.reference.deprecated_headers.process_times_hpp.class__run_timer_" title="Class
+ run_timer">Class
+ <code class="computeroutput"><span class="identifier">run_timer</span></code></a>
+</h5></div></div></div>
+<p>
+ class <code class="computeroutput"><span class="identifier">run_timer</span></code> provides
+ a complete run time reporting package that can be invoked in a single
+ line of code. The reporting is controled by two parameters:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ format : The output format
+ </li>
+<li>
+ places(precission): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ 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
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">r</span></code>
+ : real process clock
+ </li>
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">u</span></code>
+ : user process clock
+ </li>
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : system process clock
+ </li>
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
+ : user+system process clock
+ </li>
+<li>
+<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>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">run_timer</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">process_timer</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">run_timer</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">run_timer</span><span class="special">();</span>
+
+ <span class="keyword">void</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">test_report</span><span class="special">(</span> <span class="identifier">duration</span> <span class="identifier">real_</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">user_</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">system_</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">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="stopwatch_reporters.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../examples.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/process_cpu_related.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/process_cpu_related.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,227 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Process CPU
+ related</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../reference.html" title=" Reference ">
+<link rel="prev" href="cpp0x.html" title=" Included on the C++0x
+ recommendation">
+<link rel="next" href="stopwatches.html" title="Stopwatches">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="cpp0x.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="stopwatches.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.reference.process_cpu_related"></a><a href="process_cpu_related.html" title="Process CPU
+ related">Process CPU
+ related</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_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">process_clocks</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="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_real_cpu_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_user_cpu_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_system_cpu_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_">Class
+ <code class="computeroutput"><span class="identifier">process_clocks</span></code></a></span></dt>
+</dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.process_cpu_related.process_clocks_hpp"></a><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp" title="
+ Header <boost/chrono/process_clocks.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">process_clocks</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="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_real_cpu_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_user_cpu_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_system_cpu_clock_">Class
+ <code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a></span></dt>
+<dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_">Class
+ <code class="computeroutput"><span class="identifier">process_clocks</span></code></a></span></dt>
+</dl></div>
+<p>
+ Knowing how long a program takes to execute is useful in both test and
+ production environments. It is also helpful if such timing information
+ is broken down into real (wall clock) time, CPU time spent by the user,
+ and CPU time spent by the operating system servicing user requests.
+ </p>
+<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">process_real_cpu_clock</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">process_user_cpu_clock</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">process_system_cpu_clock</span><span class="special">;</span>
+ <span class="keyword">class</span> <span class="identifier">process_clocks</span><span class="special">;</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_real_cpu_clock_"></a><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_real_cpu_clock_" title="Class
+ process_real_cpu_clock">Class
+ <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code>
+ satisfy the Clock Requirements.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code>
+ class provides access to the real process wall-clock monotonic clock,
+ i.e. the real CPU-time clock of the calling process. The process relative
+ current time can be obtained by calling <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_real_cpu_clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</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_monotonic</span> <span class="special">=</span> <span class="keyword">true</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_user_cpu_clock_"></a><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_user_cpu_clock_" title="Class
+ process_user_cpu_clock">Class
+ <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code>
+ satisfy the Clock Requirements.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code>
+ class provides access to the user CPU-time monotonic clock of the calling
+ process. The process relative user current time can be obtained by calling
+ <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_user_cpu_clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_user_cpu_clock</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_monotonic</span> <span class="special">=</span> <span class="keyword">true</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_system_cpu_clock_"></a><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_system_cpu_clock_" title="Class
+ process_system_cpu_clock">Class
+ <code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code>
+ satisfy the Clock Requirements.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code>
+ class provides access to the system CPU-time monotonic clockof the calling
+ process. The process relative system current time can be obtained by
+ calling <code class="computeroutput"><span class="identifier">process_system_cpu_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_system_cpu_clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_system_cpu_clock</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_monotonic</span> <span class="special">=</span> <span class="keyword">true</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_"></a><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_" title="Class
+ process_clocks">Class
+ <code class="computeroutput"><span class="identifier">process_clocks</span></code></a>
+</h5></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_.class__durations_">Class
+ <code class="computeroutput"><span class="identifier">durations</span></code></a></span></dt></dl></div>
+<p>
+ <code class="computeroutput"><span class="identifier">process_clocks</span></code> can be
+ considered as a <code class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span> <span class="identifier">process_user_cpu_clock</span><span class="special">,</span> <span class="identifier">process_system_cpu_clock</span><span class="special">></span></code>. Obviously it doesn't satisfy the
+ Clock Requirements.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_clocks</span></code> provides
+ a thin wrapper around the operating system's process timer API. For POSIX-like
+ systems, that's the times() function, while for Windows, it's the GetProcessTimes()
+ function.
+ </p>
+<p>
+ The process relative real, user and system current time can be obtained
+ at once by calling <code class="computeroutput"><span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_clocks</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">duration</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="identifier">duration</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><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_clocks</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_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
+
+ <span class="keyword">struct</span> <span class="identifier">durations</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">durations</span> <span class="special">&</span> <span class="identifier">times</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_.class__durations_"></a><a href="process_cpu_related.html#boost_chrono.reference.process_cpu_related.process_clocks_hpp.class__process_clocks_.class__durations_" title="Class
+ durations">Class
+ <code class="computeroutput"><span class="identifier">durations</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">durations</span> <span class="special">{</span>
+ <span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">real</span><span class="special">;</span> <span class="comment">// real (i.e wall clock) time
+</span> <span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">user</span><span class="special">;</span> <span class="comment">// user cpu time
+</span> <span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">system</span><span class="special">;</span> <span class="comment">// system cpu time
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="cpp0x.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="stopwatches.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,550 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Stopwatch
+ Reporters</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../reference.html" title=" Reference ">
+<link rel="prev" href="stopwatches.html" title="Stopwatches">
+<link rel="next" href="deprecated_headers.html" title="Deprecated
+ Headers">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="stopwatches.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="deprecated_headers.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters"></a><a href="stopwatch_reporters.html" title="Stopwatch
+ Reporters">Stopwatch
+ Reporters</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_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">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">Formatter
Requirements</span></dt>
+<dt><span class="section">Formatter
related traits</span></dt>
+<dt><span class="section"><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp.template_class__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">stopwatch_reporter
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.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">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="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_formatter_hpp.class__stopwatch_formatter_">Class
+ <code class="computeroutput"><span class="identifier">stopwatch_formatter</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.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">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="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_accumulator_formatter_hpp.class__stopwatch_accumulator_formatter_">Class
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a></span></dt></dl></dd>
+<dt><span class="section"><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_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">process_stopwatches_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="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_reporter_hpp.class__process_stopwatches_reporter_">Class
+ <code class="computeroutput"><span class="identifier">process_stopwatches_reporter</span></code></a></span></dt></dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp" title="
+ Header <boost/chrono/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">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">Formatter
Requirements</span></dt>
+<dt><span class="section">Formatter
related traits</span></dt>
+<dt><span class="section"><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp.template_class__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">stopwatch_reporter
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">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> <span class="identifier">stopwatch_reporter</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_reporter</span><span class="special">;</span>
+ <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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">monotonic_stopwatch_reporter</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_reporter</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_stopwatch_reporter</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_stopwatch_reporter</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_stopwatch_reporter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp._formatter__requirements"></a>Formatter
Requirements
+</h5></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 precission.
+ </p>
+<p>
+ A Stopwatch must meet the requirements in the following Table.
+ </p>
+<p>
+ In this table <code class="computeroutput"><span class="identifier">F</span></code> denote
+ Fromaters types, <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="id4860232"></a><p class="title"><b>Table 3. Stopwatch Requirements</b></p>
+<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">F</span><span class="special">::</span><span class="identifier">output</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 precission 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 precission <code class="computeroutput"><span class="identifier">p</span></code>.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp._formatter__related_traits"></a>Formatter
related traits
+</h5></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 <code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code>
+ class when the <code class="computeroutput"><span class="identifier">Formatter</span></code>
+ parameter is not explicit.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp.template_class__stopwatch_reporter___"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp.template_class__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 <code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code>
+ 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:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ format : The output format
+ </li>
+<li>
+ places(precission): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ The default places is given by Formatter::default_places. 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">Stopwatch</span> <span class="special">{</span>
+<span class="keyword">public</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_reporter_hpp._stopwatch_reporter__useful_typedefs"></a>stopwatch_reporter
useful typedefs
+</h5></div></div></div>
+<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_reporter</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_reporter</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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_reporter</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">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_stopwatch_reporter</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_reporter</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_reporter</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">stopwatch_reporter</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_stopwatch_reporter</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">stopwatch_reporter</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_stopwatch_reporter</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">stopwatch_reporter</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_stopwatch_reporter</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_formatter_hpp"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_formatter_hpp" title="
+ Header <boost/chrono/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">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="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_formatter_hpp.class__stopwatch_formatter_">Class
+ <code class="computeroutput"><span class="identifier">stopwatch_formatter</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">stopwatch_formatter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_formatter_hpp.class__stopwatch_formatter_"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_formatter_hpp.class__stopwatch_formatter_" title="Class
+ stopwatch_formatter">Class
+ <code class="computeroutput"><span class="identifier">stopwatch_formatter</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">stopwatch_formatter</span></code> is
+ a model of <code class="computeroutput"><span class="identifier">Formatter</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">stopwatch_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">m_cout</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">m_default_places</span> <span class="special">=</span> <span class="number">3</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="special">{</span> <span class="keyword">return</span> <span class="identifier">m_default_places</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="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. The default format
+ is "\n%ts\n", where
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+<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" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_accumulator_formatter_hpp"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_accumulator_formatter_hpp" title="
+ Header <boost/chrono/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">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="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_accumulator_formatter_hpp.class__stopwatch_accumulator_formatter_">Class
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</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">stopwatch_accumulator_formatter</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.stopwatch_accumulator_formatter_hpp.class__stopwatch_accumulator_formatter_"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.stopwatch_accumulator_formatter_hpp.class__stopwatch_accumulator_formatter_" title="Class
+ stopwatch_accumulator_formatter">Class
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator_formatter</span></code>
+ is a model of <code class="computeroutput"><span class="identifier">Formatter</span></code>
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">stopwatch_accumulator_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">m_cout</span><span class="special">();</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">m_default_places</span> <span class="special">=</span> <span class="number">3</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="special">{</span> <span class="keyword">return</span> <span class="identifier">m_default_places</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="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. The default format
+ is "\n"Count<code class="literal">%c times Sum</code>%ss Min<code class="literal">%ms
+ Max</code>%Ms Mean=%as\n", where
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<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>
+<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>
+<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>
+<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>
+<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>
+</ul></div>
+<p>
+ The time is given using the suffix "s" following the System
+ International d'Unites Std.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_reporter_hpp"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_reporter_hpp" title="
+ Header <boost/chrono/process_stopwatches_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">process_stopwatches_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="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_reporter_hpp.class__process_stopwatches_reporter_">Class
+ <code class="computeroutput"><span class="identifier">process_stopwatches_reporter</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">process_stopwatches_reporter</span><span class="special">;</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_reporter_hpp.class__process_stopwatches_reporter_"></a><a href="stopwatch_reporters.html#boost_chrono.reference.stopwatch_reporters.process_process_stopwatches_reporter_hpp.class__process_stopwatches_reporter_" title="Class
+ process_stopwatches_reporter">Class
+ <code class="computeroutput"><span class="identifier">process_stopwatches_reporter</span></code></a>
+</h5></div></div></div>
+<p>
+ <code class="computeroutput"><span class="identifier">process_stopwatches_reporter</span></code>
+ is the <code class="computeroutput"><span class="identifier">stopwatches_reporter</span><span class="special"><></span></code> associated to the clock tuple
+ <code class="computeroutput"><span class="identifier">process_clocks</span></code>.
+ </p>
+<p>
+ class <code class="computeroutput"><span class="identifier">process_stopwatches_reporter</span></code>
+ provides a complete run time reporting package that can be invoked in
+ a single line of code. The reporting is controled by two parameters:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ format : The output format
+ </li>
+<li>
+ places(precission): the number of decimal placess used.
+ </li>
+</ul></div>
+<p>
+ 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
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">r</span></code>
+ : real process clock
+ </li>
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">u</span></code>
+ : user process clock
+ </li>
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">s</span></code>
+ : system process clock
+ </li>
+<li>
+<code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
+ : user+system process clock
+ </li>
+<li>
+<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>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_stopwatches_reporter</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">process_timer</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">explicit</span> <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="identifier">process_stopwatches_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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">process_stopwatches_reporter</span><span class="special">();</span>
+
+ <span class="keyword">void</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">test_report</span><span class="special">(</span> <span class="identifier">duration</span> <span class="identifier">real_</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">user_</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">system_</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">static</span> <span class="keyword">int</span> <span class="identifier">default_places</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="stopwatches.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="deprecated_headers.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,817 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Stopwatches</title>
+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
+<link rel="start" href="../../index.html" title="Boost.Chrono">
+<link rel="up" href="../reference.html" title=" Reference ">
+<link rel="prev" href="process_cpu_related.html" title="Process CPU
+ related">
+<link rel="next" href="stopwatch_reporters.html" title="Stopwatch
+ Reporters">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="process_cpu_related.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="stopwatch_reporters.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_chrono.reference.stopwatches"></a>Stopwatches
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Stopwatch
Requirements</span></dt>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.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">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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.template_class__stopwatch___">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section">stopwatch
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.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">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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__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">stopwatch_accumulator
useful typedefs</span></dt>
+</dl></dd>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.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">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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__stopwatch_resumer___">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch_resumer</span><span class="special"><></span></code></a></span></dt>
+</dl></dd>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.process_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">process_stopwatches</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="stopwatches.html#boost_chrono.reference.stopwatches.process_stopwatches_hpp.class__process_stopwatches_">Class
+ <code class="computeroutput"><span class="identifier">process_stopwatches</span></code></a></span></dt></dl></dd>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatches._stopwatch__requirements"></a>Stopwatch
Requirements
+</h4></div></div></div>
+<p>
+ A Stopwatch measure the amount of time elapsed from a particular time when
+ activated to when it is deactivated, or the accumulation of them.
+ </p>
+<p>
+ A Stopwatch must meet the requirements in the following Table.
+ </p>
+<p>
+ 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="id4851680"></a><p class="title"><b>Table 2. Stopwatch Requirements</b></p>
+<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 the CLock concept.
+ </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">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">paire</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>
+ starts 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>
+ stops 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>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_hpp"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp" title="
+ Header <boost/chrono/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">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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.template_class__stopwatch___">Template
+ Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></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">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">class</span> <span class="identifier">stopwatch</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> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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">monotonic_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="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_stopwatch</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_stopwatch</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_stopwatch</span><span class="special">;</span>
+<span class="special">}}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_hpp.template_class__stopwatch___"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.template_class__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>
+<p>
+ <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code>
+ is a model of a <code class="computeroutput"><span class="identifier">Stopwatch</span></code>.
+ </p>
+<p>
+ Knowing how long a part of a program takes to execute is useful in both
+ test and production environments. A <code class="computeroutput"><span class="identifier">stopwatch</span></code>
+ 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 coudl 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">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">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">system</span><span class="special">::</span><span class="identifier">throws</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><span class="identifier">timer</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="keyword">typedef</span> <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> <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</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">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="keyword">typedef</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="special">></span> <span class="identifier">reporter</span><span class="special">;</span>
+
+<span class="special">};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_hpp._stopwatch__useful_typedefs"></a>stopwatch
useful typedefs
+</h5></div></div></div>
+<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> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_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>
+
+<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">process_real_cpu_clock</span> <span class="special">></span> <span class="identifier">process_real_cpu_stopwatch</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">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">process_user_cpu_clock</span> <span class="special">></span> <span class="identifier">process_user_cpu_stopwatch</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">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">process_system_cpu_clock</span> <span class="special">></span> <span class="identifier">process_system_cpu_stopwatch</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp" title="
+ Header <boost/chrono/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">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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__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">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">class</span> <span class="identifier">Accumulator</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_accumulator</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> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</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">monotonic_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="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">process_real_cpu_stopwatch_accumulator</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">process_user_cpu_stopwatch_accumulator</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">process_system_cpu_stopwatch_accumulator</span><span class="special">;</span>
+
+<span class="special">}}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_c">
+ Constructor <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_reset">
+ Member function<code class="computeroutput"><span class="identifier">reset</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_elapsed">
+ Member function<code class="computeroutput"><span class="identifier">elapsed</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_accumulated">
+ Member function<code class="computeroutput"><span class="identifier">accumulated</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 Stopwatch that
+ allows to accumulate the time in several times instead of at once as
+ it is the case of the class <code class="computeroutput"><span class="identifier">stopwatch</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">stopwatch_accumulator</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="identifier">Accumulator</span> <span class="identifier">accumulator</span><span class="special">;</span>
+
+ <span class="identifier">stopwatch_accumulator</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</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">system</span><span class="special">::</span><span class="identifier">throws</span><span class="special">);</span>
+
+ <span class="identifier">accumulator</span><span class="special">&</span> <span class="identifier">accumulated</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="keyword">typedef</span> <span class="identifier">stopwatch_runner</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="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_accumulator</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">stopwatch_accumulator</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="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="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">reporter</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_c"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.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.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_start"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_start" title="
+ Member functionstart()">
+ Member function<code class="computeroutput"><span class="identifier">start</span><span class="special">()</span></code></a>
+</h6></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">system</span><span class="special">::</span><span class="identifier">throws</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 Clock::now
+ function can throw.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_stop"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_stop" title="
+ Member functionstop()">
+ Member function<code class="computeroutput"><span class="identifier">stop</span><span class="special">()</span></code></a>
+</h6></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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Stops running the stopwatch.
+ Accumulates the elapsed time since the last start-like operation +
+ the partial accumulated by resume/suspend operation.
+ </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 Clock::now
+ function can throw.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_suspend"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_suspend" title="
+ Member functionsuspend()">
+ Member function<code class="computeroutput"><span class="identifier">suspend</span><span class="special">()</span></code></a>
+</h6></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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Suspends the stopwatch. Accumulates
+ the elapsed time since the last start-like operation on a partial duration.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Any exception the Clock::now
+ function can throw.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_resume"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_resume" title="
+ Member functionresume()">
+ Member function<code class="computeroutput"><span class="identifier">resume</span><span class="special">()</span></code></a>
+</h6></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">system</span><span class="special">::</span><span class="identifier">throws</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" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_restart"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_restart" title="
+ Member functionrestart()">
+ Member function<code class="computeroutput"><span class="identifier">restart</span><span class="special">()</span></code></a>
+</h6></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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+</pre>
+<p>
+ <span class="bold"><strong>Effect:</strong></span> Stop/Start 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" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_reset"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_reset" title="
+ Member functionreset()">
+ 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 stopwatch and reset
+ the accumulator.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_elapsed"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_elapsed" title="
+ Member functionelapsed()">
+ Member function<code class="computeroutput"><span class="identifier">elapsed</span><span class="special">()</span></code></a>
+</h6></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">system</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> Nothing.
+ </p>
+<p>
+ <span class="bold"><strong>Note:</strong></span> the system::error_code &
+ parameter is here to conform to the Timer concept.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h6 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_accumulated"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.template_class__stopwatch_accumulator___.stopwatch_accumulator_accumulated" title="
+ Member functionaccumulated()">
+ Member function<code class="computeroutput"><span class="identifier">accumulated</span><span class="special">()</span></code></a>
+</h6></div></div></div>
+<pre class="programlisting"><span class="identifier">accumulator</span><span class="special">&</span> <span class="identifier">accumulated</span><span class="special">();</span>
+</pre>
+<p>
+ <span class="bold"><strong>Returns:</strong></span> the assocaited accumulator.
+ </p>
+<p>
+ <span class="bold"><strong>Throw:</strong></span> Nothing.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp._stopwatch_accumulator__useful_typedefs"></a>stopwatch_accumulator
useful typedefs
+</h5></div></div></div>
+<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>
+</pre>
+<p>
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::system_clock
+ > system_stopwatch_accumulator; #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef boost::chrono::stopwatch_accumulator< boost::chrono::monotonic_clock
+ > monotonic_stopwatch_accumulator; #endif typedef boost::chrono::stopwatch_accumulator<
+ boost::chrono::high_resolution_clock > high_resolution_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">process_real_cpu_clock</span> <span class="special">></span> <span class="identifier">process_real_cpu_stopwatch_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">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">process_user_cpu_clock</span> <span class="special">></span> <span class="identifier">process_user_cpu_stopwatch_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">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">process_system_cpu_clock</span> <span class="special">></span> <span class="identifier">process_system_cpu_stopwatch_accumulator</span><span class="special">;</span>
+</pre>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_scoped_hpp"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp" title="
+ Header <boost/chrono/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">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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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">Clock</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">Clock</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">Clock</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" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__stopwatch_runner___"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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. Start the
+ associated accumulator at construction time, and stop 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_type</span><span class="special">;</span>
+ <span class="identifier">stopwatch_runner</span><span class="special">(</span><span class="identifier">stopwatch_type</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">system</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" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__stopwatch_suspender___"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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. Suspend
+ the associated accumulator at construction time, and resume 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_type</span><span class="special">;</span>
+ <span class="identifier">stopwatch_suspender</span><span class="special">(</span><span class="identifier">stopwatch_type</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">system</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" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__stopwatch_resumer___"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp.template_class__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. Resume
+ the associated accumulator at construction time, and suspecd 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_type</span><span class="special">;</span>
+ <span class="identifier">stopwatch_resumer</span><span class="special">(</span><span class="identifier">stopwatch_type</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">system</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 class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.reference.stopwatches.process_stopwatches_hpp"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.process_stopwatches_hpp" title="
+ Header <boost/chrono/process_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">process_stopwatches</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="stopwatches.html#boost_chrono.reference.stopwatches.process_stopwatches_hpp.class__process_stopwatches_">Class
+ <code class="computeroutput"><span class="identifier">process_stopwatches</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">process_stopwatches</span><span class="special">;</span>
+
+<span class="special">}</span> <span class="special">}</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.stopwatches.process_stopwatches_hpp.class__process_stopwatches_"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.process_stopwatches_hpp.class__process_stopwatches_" title="Class
+ process_stopwatches">Class
+ <code class="computeroutput"><span class="identifier">process_stopwatches</span></code></a>
+</h5></div></div></div>
+<p>
+ Knowing how long a program takes to execute is useful in both test and
+ production environments. It is also helpful if such timing information
+ is broken down into real (wall clock) time, CPU time spent by the user,
+ and CPU time spent by the operating system servicing user requests.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">process_stopwatches</span></code> is
+ the <code class="computeroutput"><span class="identifier">stopwatches</span><span class="special"><></span></code>
+ equivalent associated to the pseudo-clock <code class="computeroutput"><span class="identifier">process_clocks</span></code>.
+ It behaves like <code class="computeroutput"><span class="identifier">stopwatches</span><span class="special"><></span></code> but it uses the specific <code class="computeroutput"><span class="identifier">process_clocks</span><span class="special">:</span><span class="identifier">now</span><span class="special">()</span></code>
+ function.
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_stopwatches</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">process_clocks</span> <span class="identifier">clock</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">process_clocks</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="identifier">process_clocks</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">time_point</span><span class="special">;</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">process_stopwatches</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">process_stopwatches</span><span class="special">();</span>
+ <span class="keyword">void</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+ <span class="keyword">void</span> <span class="identifier">elapsed</span><span class="special">(</span> <span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">durations</span> <span class="special">&</span> <span class="identifier">times</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">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
+<span class="special">};</span>
+</pre>
+</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 © 2008 Howard Hinnant<br>Copyright © 2006 , 2008 Beman Dawes<br>Copyright © 2009 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="process_cpu_related.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="stopwatch_reporters.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -39,7 +39,7 @@
Installing Chrono</a>
</h4></div></div></div>
<a name="boost_chrono.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4816278"></a>
+<a name="id4817069"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono__emphasis__">Getting
<span class="bold"><strong>Boost.Chrono</strong></span> </a>
</h5>
@@ -53,7 +53,7 @@
Sandbox</a>.
</p>
<a name="boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___"></a><h5>
-<a name="id4816338"></a>
+<a name="id4817130"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___">Where
to install <span class="bold"><strong>Boost.Chrono</strong></span>? </a>
</h5>
@@ -69,7 +69,7 @@
variable. Any help is welcome.
</p>
<a name="boost_chrono.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4816381"></a>
+<a name="id4817172"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono__emphasis__">Building
<span class="bold"><strong>Boost.Chrono</strong></span> </a>
</h5>
@@ -80,7 +80,7 @@
<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">build</span>
</pre>
<a name="boost_chrono.users_guide.getting_started.install.requirements"></a><h5>
-<a name="id4816449"></a>
+<a name="id4817240"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.requirements">Requirements</a>
</h5>
<p>
@@ -125,7 +125,7 @@
</dl>
</div>
<a name="boost_chrono.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4816630"></a>
+<a name="id4817421"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_chrono__emphasis__">Building
an executable that uses <span class="bold"><strong>Boost.Chrono</strong></span>
</a>
@@ -135,7 +135,7 @@
with the Boost System library.
</p>
<a name="boost_chrono.users_guide.getting_started.install.exceptions_safety_"></a><h5>
-<a name="id4816666"></a>
+<a name="id4817457"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.exceptions_safety_">Exceptions
safety </a>
</h5>
@@ -144,7 +144,7 @@
of exception safety as long as the underlying parameters provide it.
</p>
<a name="boost_chrono.users_guide.getting_started.install.thread_safety_"></a><h5>
-<a name="id4816692"></a>
+<a name="id4817483"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.thread_safety_">Thread
safety </a>
</h5>
@@ -152,7 +152,7 @@
All functions in the library are thread-unsafe except when noted explicitly.
</p>
<a name="boost_chrono.users_guide.getting_started.install.tested_compilers_"></a><h5>
-<a name="id4816717"></a>
+<a name="id4817508"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.tested_compilers_">Tested
compilers </a>
</h5>
@@ -218,17 +218,17 @@
<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><span class="identifier">run_timer</span> <span class="identifier">rt</span><span class="special">;</span>
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_stopwatches_reporter</span> <span class="identifier">rt</span><span class="special">;</span>
</pre>
<p>
- Here is a complete program (run_timer_example.cpp):
+ Here is a complete program (process_stopwatches_reporter_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">process_times</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><span class="identifier">run_timer</span> <span class="identifier">t</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_stopwatches_reporter</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
Modified: sandbox/chrono/libs/chrono/doc/html/index.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/index.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/index.html 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -62,11 +62,15 @@
</dl></dd>
<dt><span class="section"> Reference </span></dt>
<dd><dl>
-<dt><span class="section"> Header <boost/type_traits/common_type.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/chrono.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/chrono/timer.hpp>
</span></dt>
-<dt><span class="section"> Header <boost/chrono/process_times.hpp>
</span></dt>
+<dt><span class="section"><a href="boost_chrono/reference/cpp0x.html"> Included on the C++0x
+ recommendation</a></span></dt>
+<dt><span class="section"><a href="boost_chrono/reference/process_cpu_related.html">Process CPU
+ related</a></span></dt>
+<dt><span class="section">Stopwatches</span></dt>
+<dt><span class="section"><a href="boost_chrono/reference/stopwatch_reporters.html">Stopwatch
+ Reporters</a></span></dt>
+<dt><span class="section"><a href="boost_chrono/reference/deprecated_headers.html">Deprecated
+ Headers</a></span></dt>
</dl></dd>
<dt><span class="section">Examples</span></dt>
<dd><dl>
@@ -85,8 +89,8 @@
Hinnant's original demonstration program</a></span></dt>
<dt><span class="section"><a href="boost_chrono/examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html">A
tiny program that times how long until a key is struck</a></span></dt>
-<dt><span class="section">run_timer_example.cpp</span></dt>
-<dt><span class="section">run_timer_example2.cpp</span></dt>
+<dt><span class="section">process_stopwatches_reporter_example.cpp</span></dt>
+<dt><span class="section">process_stopwatches_reporter_example2.cpp</span></dt>
<dt><span class="section">time command</span></dt>
</dl></dd>
<dt><span class="section">Appendices</span></dt>
@@ -116,7 +120,7 @@
</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: December 13, 2009 at 22:03:26 GMT</small></p></td>
+<td align="left"><p><small>Last revised: December 21, 2009 at 12:50:52 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest (original)
+++ sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -7,11 +7,11 @@
boost_chrono/users_guide/tutorial.html
boost_chrono/users_guide/ext_references.html
boost_chrono/reference.html
-boost_chrono/reference/common_type_hpp.html
-boost_chrono/reference/ratio_hpp.html
-boost_chrono/reference/chrono_hpp.html
-boost_chrono/reference/timer_hpp.html
-boost_chrono/reference/process_times_hpp.html
+boost_chrono/reference/cpp0x.html
+boost_chrono/reference/process_cpu_related.html
+boost_chrono/reference/stopwatches.html
+boost_chrono/reference/stopwatch_reporters.html
+boost_chrono/reference/deprecated_headers.html
boost_chrono/examples.html
boost_chrono/examples/si_units.html
boost_chrono/examples/how_you_override_the_duration_s_default_constructor.html
@@ -24,8 +24,8 @@
boost_chrono/examples/saturating.html
boost_chrono/examples/howard_hinnant_s_original_demonstration_program.html
boost_chrono/examples/a_tiny_program_that_times_how_long_until_a_key_is_struck.html
-boost_chrono/examples/run_timer_example_cpp.html
-boost_chrono/examples/run_timer_example2_cpp.html
+boost_chrono/examples/process_stopwatches_reporter_example_cpp.html
+boost_chrono/examples/process_stopwatches_reporter_example2_cpp.html
boost_chrono/examples/time_command.html
boost_chrono/appendices.html
boost_chrono/appendices/history.html
Added: sandbox/chrono/libs/chrono/example/stopwatch_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/example/stopwatch_example.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -0,0 +1,51 @@
+// run_timer_example.cpp ---------------------------------------------------//
+
+// Copyright Beman Dawes 2006, 2008
+
+// 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 <iostream>
+#include <boost/chrono/process_times.hpp>
+#include <boost/chrono/stopwatch.hpp>
+#include <boost/chrono/stopwatch_accumulator.hpp>
+#include <boost/chrono/cpu_clocks.hpp>
+#include <cmath>
+
+//#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+#include <boost/accumulators/statistics/stats.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/accumulators/statistics/weighted_sum.hpp>
+
+int f1(long j)
+{
+ static boost::chrono::stopwatch_accumulator<boost::chrono::process_real_cpu_clock>::reporter t(
+ "\nf1 Count=%c times Sum=%ss Min=%ms Max=%Ms Mean=%as\n");
+ boost::chrono::stopwatch_accumulator<boost::chrono::process_real_cpu_clock>::reporter::scoped_run _(t);
+ boost::chrono::stopwatch<boost::chrono::process_real_cpu_clock>::reporter x("\nF1 %dsec\n");
+ boost::chrono::run_timer y;
+
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+}
+int main()
+{
+ boost::chrono::stopwatch<boost::chrono::process_real_cpu_clock>::reporter _("\nMain %dsec\n");
+ boost::chrono::run_timer z;
+
+
+ f1(100000);
+ f1(200000);
+ f1(300000);
+ return 0;
+}
Modified: sandbox/chrono/libs/chrono/src/mac/process_clock.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/mac/process_clock.cpp (original)
+++ sandbox/chrono/libs/chrono/src/mac/process_clock.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -1,6 +1,7 @@
// boost process_timer.cpp -----------------------------------------------------------//
// Copyright Beman Dawes 1994, 2006, 2008
+// Copyright 2009 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -50,7 +51,7 @@
namespace chrono
{
- void process_clock::now( process_times & times_, system::error_code & ec )
+ void process_clocks::now( process_times & times_, system::error_code & ec )
{
tms tm;
Modified: sandbox/chrono/libs/chrono/src/posix/process_clock.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/posix/process_clock.cpp (original)
+++ sandbox/chrono/libs/chrono/src/posix/process_clock.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -44,7 +44,7 @@
namespace boost { namespace chrono {
- void process_clock::now( process_times & times_, system::error_code & ec ) {
+ void process_clocks::now( process_times & times_, system::error_code & ec ) {
tms tm;
clock_t c = ::times( &tm );
Modified: sandbox/chrono/libs/chrono/src/process_clock.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/process_clock.cpp (original)
+++ sandbox/chrono/libs/chrono/src/process_clock.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -1,6 +1,7 @@
// boost process_timer.cpp -----------------------------------------------------------//
// Copyright Beman Dawes 1994, 2006, 2008
+// Copyright 2009 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -36,5 +37,15 @@
#include "posix/process_clock.cpp"
#endif // POSIX
+namespace boost { namespace chrono {
+ void process_clocks::now( time_points & tps, system::error_code & ec ) {
+ process_times t;
+ process_clock::now(t,ec);
+ tps.real=process_clock::time_point(t.real);
+ tps.user=process_clock::time_point(t.user);
+ tps.system=process_clock::time_point(t.system);
+
+ }
+}}
Modified: sandbox/chrono/libs/chrono/src/run_timer.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/run_timer.cpp (original)
+++ sandbox/chrono/libs/chrono/src/run_timer.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -1,6 +1,7 @@
-// boost run_timer.cpp ---------------------------------------------------------------//
+// boost process_stopwatches_reporter.cpp ---------------------------------------------------------------//
// Copyright Beman Dawes 1994, 2006, 2008
+// Copyright 2009-2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -92,43 +93,43 @@
{
- run_timer::run_timer( system::error_code & ec )
+ process_stopwatches_reporter::process_stopwatches_reporter( system::error_code & ec )
: m_places(m_default_places), m_os(m_cout()) { start(ec); }
- run_timer::run_timer( std::ostream & os,
+ process_stopwatches_reporter::process_stopwatches_reporter( std::ostream & os,
system::error_code & ec )
: m_places(m_default_places), m_os(os) { start(ec); }
- run_timer::run_timer( const std::string & format,
+ process_stopwatches_reporter::process_stopwatches_reporter( const std::string & format,
system::error_code & ec )
: m_places(m_default_places), m_os(m_cout()), m_format(format) { start(ec); }
- run_timer::run_timer( std::ostream & os, const std::string & format,
+ process_stopwatches_reporter::process_stopwatches_reporter( std::ostream & os, const std::string & format,
system::error_code & ec )
: m_places(m_default_places), m_os(os), m_format(format) { start(ec); }
- run_timer::run_timer( const std::string & format, int places,
+ process_stopwatches_reporter::process_stopwatches_reporter( const std::string & format, int places,
system::error_code & ec )
: m_places(places), m_os(m_cout()), m_format(format) { start(ec); }
- run_timer::run_timer( std::ostream & os, const std::string & format,
+ process_stopwatches_reporter::process_stopwatches_reporter( std::ostream & os, const std::string & format,
int places, system::error_code & ec )
: m_places(places), m_os(os), m_format(format) { start(ec); }
- run_timer::run_timer( int places,
+ process_stopwatches_reporter::process_stopwatches_reporter( int places,
system::error_code & ec )
: m_places(places), m_os(m_cout()) { start(ec); }
- run_timer::run_timer( std::ostream & os, int places,
+ process_stopwatches_reporter::process_stopwatches_reporter( std::ostream & os, int places,
system::error_code & ec )
: m_places(places), m_os(os) { start(ec); }
- run_timer::run_timer( int places, const std::string & format,
+ process_stopwatches_reporter::process_stopwatches_reporter( int places, const std::string & format,
system::error_code & ec )
: m_places(places), m_os(m_cout()), m_format(format) { start(ec); }
- run_timer::run_timer( std::ostream & os, int places, const std::string & format,
+ process_stopwatches_reporter::process_stopwatches_reporter( std::ostream & os, int places, const std::string & format,
system::error_code & ec )
: m_places(places), m_os(os), m_format(format) { start(ec); }
- // run_timer::report -------------------------------------------------------------//
+ // process_stopwatches_reporter::report -------------------------------------------------------------//
- void run_timer::report( system::error_code & ec )
+ void process_stopwatches_reporter::report( system::error_code & ec )
{
m_reported = true;
if ( m_format.empty() ) m_format = default_format;
@@ -156,9 +157,9 @@
}
}
- // run_timer::test_report --------------------------------------------------------//
+ // process_stopwatches_reporter::test_report --------------------------------------------------------//
- void run_timer::test_report( duration real_, duration user_, duration system_ )
+ void process_stopwatches_reporter::test_report( duration real_, duration user_, duration system_ )
{
if ( m_format.empty() ) m_format = default_format;
Modified: sandbox/chrono/libs/chrono/src/run_timer_static.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/run_timer_static.cpp (original)
+++ sandbox/chrono/libs/chrono/src/run_timer_static.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -1,6 +1,7 @@
// boost run_timer_static.cpp --------------------------------------------------------//
// Copyright Beman Dawes 2008
+// Copyright 2009-2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -28,7 +29,7 @@
namespace chrono
{
- std::ostream & run_timer::m_cout() { return std::cout; }
+ std::ostream & process_stopwatches_reporter::m_cout() { return std::cout; }
} // namespace chrono
} // namespace boost
Modified: sandbox/chrono/libs/chrono/src/win/process_clock.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/win/process_clock.cpp (original)
+++ sandbox/chrono/libs/chrono/src/win/process_clock.cpp 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -1,6 +1,7 @@
// boost process_timer.cpp -----------------------------------------------------------//
// Copyright Beman Dawes 1994, 2006, 2008
+// Copyright 2009 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -24,7 +25,7 @@
namespace chrono
{
- void process_clock::now( process_times & times_, system::error_code & ec )
+ void process_clocks::now( process_times & times_, system::error_code & ec )
{
// note that Windows uses 100 nanosecond ticks for FILETIME
Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2009-12-21 11:56:04 EST (Mon, 21 Dec 2009)
@@ -87,3 +87,9 @@
[ run run_timer_test.cpp : : : <library>/boost/system//boost_system : run_timer_test_dll ]
[ run test_minmax.cpp : : : <library>/boost/system//boost_system : test_min_max_dll ]
;
+
+ test-suite "stopwatch"
+ :
+ [ run ../example/stopwatch_example.cpp : : : <link>static ]
+ [ run ../example/stopwatch_example.cpp : : : <library>/boost/system//boost_system : stopwatch_example_dll ]
+ ;
\ No newline at end of file
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