|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63677 - in sandbox/chrono/libs/chrono/doc: . html html/boost_chrono html/boost_chrono/appendices html/boost_chrono/overview html/boost_chrono/reference html/boost_chrono/users_guide
From: vicente.botet_at_[hidden]
Date: 2010-07-05 18:54:03
Author: viboes
Date: 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
New Revision: 63677
URL: http://svn.boost.org/trac/boost/changeset/63677
Log:
Update doc
Text files modified:
sandbox/chrono/libs/chrono/doc/chrono.qbk | 253 +++++++++++++++++-----------------
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html | 2
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html | 12
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html | 6
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html | 4
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/overview.html | 6
sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html | 10
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html | 3
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html | 2
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html | 2
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html | 230 +++++++++++++++++++++----------
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html | 16 +-
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html | 286 +++++++++++++++------------------------
sandbox/chrono/libs/chrono/doc/html/index.html | 2
16 files changed, 434 insertions(+), 412 deletions(-)
Modified: sandbox/chrono/libs/chrono/doc/chrono.qbk
==============================================================================
--- sandbox/chrono/libs/chrono/doc/chrono.qbk (original)
+++ sandbox/chrono/libs/chrono/doc/chrono.qbk 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -231,7 +231,7 @@
* a Stopclocks higher layer: provide a complete stopclock reporting package that can be invoked in a single line of code.
* __stopwatch_reporter__, convenient reporting of models of __Stopwatch__ results.
- * __stopclock_clock__ shortcut of `stopwatch_reporter<stopwatch<Clock>>`
+ * __stopclock_clock__ shortcut of `__stopwatch_reporter__<__stopwatch__<Clock>>`
* Allows wide characters
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 clocks provide 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.
@@ -302,16 +302,16 @@
[/3 concrete process clocks:
-# `process_real_CPU_clock`,
-# `process_user_CPU_clock`,
-# `process_system_CPU_clock`
+# __process_real_CPU_clock__,
+# __process_user_CPU_clock__,
+# __process_system_CPU_clock__
providing a
]
__Boost_Chrono__ provides
thin wrappers 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.
-[/These clocks capture the specific time unitarily. __Boost_Chrono__ provides also a clock `process_cpu_clock` that captures the three times at once.
+[/These clocks capture the specific time unitarily. __Boost_Chrono__ provides also a clock __process_cpu_clock__ that captures the three times at once.
]
[/
@@ -624,7 +624,7 @@
typedef __ratio__<25, 15> also_five_thirds; // also_five_thirds::num == 5, also_five_thirds::den == 3
typedef ratio_divide<five_thirds, also_five_thirds>::type one; // one::num == 1, one::den == 1
-This facility also includes convenience typedefs for the SI prefixes `atto` through `exa` corresponding to their internationally recognized definitions (in terms of __ratio__). This is a tremendous syntactic convenience. It will prevent errors in specifying constants as one no longer has to double count the number of zeros when trying to write million or billion.
+This facility also includes convenience typedefs for the SI prefixes __atto through __exa corresponding to their internationally recognized definitions (in terms of __ratio__). This is a tremendous syntactic convenience. It will prevent errors in specifying constants as one no longer has to double count the number of zeros when trying to write million or billion.
[*Example:]
@@ -646,19 +646,19 @@
* __microseconds__
* __nanoseconds__
-These units were chosen as a subset of the boost library because they are the most common units used when sleeping, waiting on a condition variable, or waiting to obtain the lock on a mutex. Each of these units is nothing but a thin wrapper around a signed integral count. That is, when you construct `minutes(3)`, all that happens is a `3` is stored inside of minutes. When you construct `microseconds(3)`, all that happens is a `3` is stored inside of microseconds.
+These units were chosen as a subset of the boost library because they are the most common units used when sleeping, waiting on a condition variable, or waiting to obtain the lock on a mutex. Each of these units is nothing but a thin wrapper around a signed integral count. That is, when you construct __minutes__`(3)`, all that happens is a `3` is stored inside of minutes. When you construct __microseconds__`(3)`, all that happens is a `3` is stored inside of __microseconds__.
-The only context in which these different types differ is when being converted to one another. At this time, unit-specific compile-time conversion constants are used to convert the source unit to the target unit. Only conversions from coarser units to finer units are allowed (in boost). This restriction ensures that all conversions are always exact. That is, `microseconds` can always represent any value __minutes__ has.
+The only context in which these different types differ is when being converted to one another. At this time, unit-specific compile-time conversion constants are used to convert the source unit to the target unit. Only conversions from coarser units to finer units are allowed (in boost). This restriction ensures that all conversions are always exact. That is, __microseconds__ can always represent any value __minutes__ has.
In Boost.DateTime, these units are united via inheritance. __Boost_Chrono__ instead unites these units through the class template __duration__. That is, in __Boost_Chrono__ all six of the above units are nothing but typedefs to different instantiations of __duration__. This change from Boost.DateTime has a far reaching positive impact, while not changing the syntax of the everyday use at all.
The most immediate positive impact is that the library can immediately generate any unit, any precision it needs. This is sometimes necessary when doing comparisons or arithmetic between __duration_s__ of differing precision, assuming one wants the comparison and arithmetic to be exactly correct.
-A secondary benefit is that by publishing the class template __duration__ interface, user code can very easily create __duration_s__ with any precision they desire. The __ratio__ utility is used to specify the precision, so as long as the precision can be expressed by a rational constant with respect to seconds, this framework can exactly represent it (one third of a second is no problem, and neither is one third of a `femto` second). All of this utility and flexibility comes at no cost just by making use of the no-run-time-overhead __ratio__ facility.
+A secondary benefit is that by publishing the class template __duration__ interface, user code can very easily create __duration_s__ with any precision they desire. The __ratio__ utility is used to specify the precision, so as long as the precision can be expressed by a rational constant with respect to seconds, this framework can exactly represent it (one third of a second is no problem, and neither is one third of a __femto second). All of this utility and flexibility comes at no cost just by making use of the no-run-time-overhead __ratio__ facility.
-In Boost.DateTime, `hours` does not have the same representation as __nanoseconds__. The former is usually represented with a `long` whereas a `long long` is required for the latter. The reason for this is simply range. You don't need many hours to cover an extremely large range of time. But this isn't true of nanoseconds. Being able to reduce the sizeof overhead for some units when possible, can be a significant performance advantage.
+In Boost.DateTime, __hours does not have the same representation as __nanoseconds__. The former is usually represented with a `long` whereas a `long long` is required for the latter. The reason for this is simply range. You don't need many hours to cover an extremely large range of time. But this isn't true of nanoseconds. Being able to reduce the sizeof overhead for some units when possible, can be a significant performance advantage.
-__Boost_Chrono__ continues, and generalizes that philosophy. Not only can one specify the precision of a __duration__, one can also specify its representation. This can be any integral type, or even a floating point type. Or it can be a user-defined type which emulates an arithmetic type. The six predefined units all use signed integral types as their representation. And they all have a minimum range of +/- 292 years. __nanoseconds__ needs 64 bits to cover that range. `hours` needs only 23 bits to cover that range.
+__Boost_Chrono__ continues, and generalizes that philosophy. Not only can one specify the precision of a __duration__, one can also specify its representation. This can be any integral type, or even a floating point type. Or it can be a user-defined type which emulates an arithmetic type. The six predefined units all use signed integral types as their representation. And they all have a minimum range of +/- 292 years. __nanoseconds__ needs 64 bits to cover that range. __hours needs only 23 bits to cover that range.
[section So What Exactly is a `duration` and How Do I Use One?]
@@ -890,18 +890,18 @@
[section How to get the actual CPU milliseconds (or other units?) used by the current thread between end and start?]
-You can use __duration_cast__`<>` to convert the `thread_clock::duration` into whatever units you desire. This facility will round down (truncate) if an exact conversion is not possible. Ex:
+You can use __duration_cast__`<>` to convert the __thread_clock__`::duration` into whatever units you desire. This facility will round down (truncate) if an exact conversion is not possible. Ex:
- typedef boost::chrono::milliseconds ms;
- ms d = boost::chrono::duration_cast<ms>(end - start);
+ typedef boost::chrono::__milliseconds__ ms;
+ ms d = boost::chrono::__duration_cast__<ms>(end - start);
// d now holds the number of milliseconds from start to end.
std::cout << ms.count() << "ms\n";
-As `boost::chrono::thread_clock::duration` is nanoseconds, we can convert to __nanoseconds__, or some integral-based duration which __nanoseconds__ will always exactly convert to, then __duration_cast__`<>` is unnecessary:
+As `boost::chrono::__thread_clock__::duration` is __nanoseconds__, we can convert to __nanoseconds__, or some integral-based duration which __nanoseconds__ will always exactly convert to, then __duration_cast__`<>` is unnecessary:
- typedef boost::chrono::nanoseconds ns;
+ typedef boost::chrono::__nanoseconds__ ns;
ns d = end - start;
std::cout << ns.count() << "ns\n";
@@ -913,7 +913,7 @@
If you're not sure if you need __duration_cast__`<>` or not, feel free to try it without. If the conversion is exact, or if the destination has a floating point representation, it will compile. Else it will not compile.
-If you would like to programmatically inspect `thread_clock::duration`, you can get the representation type with `thread_clock::rep`, and the tick period with `thread_clock::period` (which should be a type __ratio__ which has nested values `__ratio__::num` and `__ratio__::den`). The tick period of __thread_clock__ is `thread_clock::period::num / thread_clock::period::den` seconds: 1/1000000000 in this case (1 billionth of a second), stored in a long long.
+If you would like to programmatically inspect `__thread_clock__::duration`, you can get the representation type with `__thread_clock__::rep`, and the tick period with `__thread_clock__::period` (which should be a type __ratio__ which has nested values `__ratio__::num` and `__ratio__::den`). The tick period of __thread_clock__ is `__thread_clock__::period::num / __thread_clock__::period::den` seconds: 1/1000000000 in this case (`1` billionth of a second), stored in a `long long`.
If you need to use __duration_cast__`<>`, but want to round up, instead of down when the conversion is inexact, here is a handy little helper function to do so. Writing it is actually a good starter project for understanding chrono:
@@ -922,13 +922,13 @@
round_up(boost::chrono::__duration__<Rep, Period> d)
{
// first round down
- ToDuration result = boost::chrono::duration_cast<ToDuration>(d);
+ ToDuration result = boost::chrono::__duration_cast__<ToDuration>(d);
if (result < d) // comparisons are *always* exact
++result; // increment by one tick period
return result;
}
- typedef boost::chrono::milliseconds ms;
+ typedef boost::chrono::__milliseconds__ ms;
ms d = round_up<ms>(end - start);
// d now holds the number of milliseconds from start to end, rounded up.
std::cout << ms.count() << "ms\n";
@@ -998,16 +998,16 @@
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.
-A Stopwatch allows to start, stop, suspend and resume the measure of the eleapsed time.
+A __Stopwatch__ allows to `start`, `stop`, `suspend` and `resume` the measure of the eleapsed time.
__stopwatch__`<>` is the basic model of __Stopwatch__ allowing to make a single measure.
At the user level, the main use case of measuring the elapsed time is to report these measures on the display.
-__stopwatch_reporter__`<>` provides a run time reporting package that can be invoked in a single line of code to report the usage of a Clock.
+__stopwatch_reporter__`<>` provides a run time reporting package that can be invoked in a single line of code to report the usage of a __Clock__.
For example
using namespace boost::chrono;
int f1(long j) {
- stopwatch_reporter<stopwatch<> > _;
+ __stopwatch_reporter__<__stopwatch__<> > _;
for ( long i = 0; i < j; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -1036,8 +1036,8 @@
using namespace boost::chrono;
int f1(long j) {
- static stopwatch_reporter<stopwatch_accumulator<> > sw;
- stopwatch_reporter<stopwatch_accumulator<> >::scoped_run _(sw);
+ static __stopwatch_reporter__<__stopwatch_accumulator__<> > sw;
+ __stopwatch_reporter__<__stopwatch_accumulator__<> >::scoped_run _(sw);
for ( long i = 0; i < j; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -1058,7 +1058,7 @@
[endsect]
-[
+[/
[section How reliable are these measures?]
[note this section need to be reworked, the ideas are there, but ...]
@@ -1070,7 +1070,7 @@
``
#include <boost/chrono/chrono.hpp>
...
- stopclock<high_resolution_clock> _;
+ __stopclock__<__high_resolution_clock__> _;
``
* When your application is multithreaded, and you use a process clock, the time you get is the delay during which your block has been executed, in concurrency with the other threads of execution. If what you want is the time spent by this specific thread another clock is needed. The library provide a __thread_clock__ that returns the time spent by the thread on platforms providing this kind of data. It can be used as follows
@@ -1078,50 +1078,51 @@
``
#include <boost/chrono/thread_clock.hpp>
...
-#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
- stopclock<thread_clock> _;
+#if defined(__BOOST_CHRONO_HAS_THREAD_CLOCK)
+ __stopclock__<__thread_clock__> _;
#else
- stopclock<process_real_cpu_clock> _;
+ __stopclock__<__process_real_cpu_clock__> _;
#endif
``
-* Nested stopclocks (usually nested function calls where each function contains a stopclock). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
+* Nested stopclocks (usually nested function calls where each function contains a __stopclock__). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
-Some measures let us think that most of the time spent by the stopclock mechanism is associated to the logging part. There are two things we can do to make the difference :
+Some measures let us think that most of the time spent by the __stopclock__ mechanism is associated to the logging part. There are two things we can do to make the difference :
-* Avoid expensive operations as logging while doing the measures. Note that reporting in itself is not too expensive as far as we don't need to flush the buffer. This can be achieved either using a stopclock accumulator, 'i.e. don't report until all the measures have been compiled and then report some statistics or using an asynchronous stream.
+* Avoid expensive operations as logging while doing the measures. Note that reporting in itself is not too expensive as far as we don't need to flush the buffer. This can be achieved either using a __stopclock_accumulator__, 'i.e. don't report until all the measures have been compiled and then report some statistics or using an asynchronous stream.
-* Introduce some cheap mechanism that allows us to make the difference between the application time and the intrinsec stopclock time. When the precission of the clock is enough, we can suspend the counting of the Clock while we are spending time reporting the measures, and resume it once the work is done. The library provide a Clock wrapper __suspendible_clock__ that make the resulting clock suspendible. The stopwatch_reporter is able to detect if the CLock is Suspendible and then suspend/resume the clock while doing the report.
+* Introduce some cheap mechanism that allows us to make the difference between the application time and the intrinsec __stopclock__ time. When the precission of the clock is enough, we can suspend the counting of the Clock while we are spending time reporting the measures, and resume it once the work is done. The library provide a Clock wrapper __suspendible_clock__ that make the resulting clock suspendible. The __stopwatch_reporter__ is able to detect if the __Clock__ is Suspendible and then `suspend`/`resume` the __Clock__ while doing the report.
- stopclock<suspendible_clock<Clock> > _;
+ __stopclock__<__suspendible_clock__<Clock> > _;
See the performances section for more deep details.
+
[endsect]
]
[section How can I prefix each report with `BOOST_CURRENT_FUNCTION` function signature?]
-You will need to give a specific format to your stopclock. You just need to concatenate your specific pattern to the default_format of the formatter.
+You will need to give a specific format to your __stopclock__. You just need to concatenate your specific pattern to the default_format of the formatter.
-For example, for a stopclock_accumulator the default formatter is stopwatch_accumulator_formatter, you will need to do something like:
+For example, for a __stopclock_accumulator__ the default formatter is __stopwatch_accumulator_formatter__, you will need to do something like:
- static stopclock_accumulator<> acc(
+ static __stopclock_accumulator__<> acc(
std::string(BOOST_CURRENT_FUNCTION) + ": "
- + stopwatch_accumulator_formatter::default_format()
+ + __stopwatch_accumulator_formatter__::default_format()
);
- stopclock_accumulator<>::scoped_run _(acc);
+ __stopclock_accumulator__<>::scoped_run _(acc);
Some of you will say that this is too long to type just to get the a report. You can of course define your own macro as
#define REPORT_FUNCTION_ACCUMULATED_LIFETIME\
- static boost::chrono::stopclock_accumulator<> \
+ static boost::chrono::__stopclock_accumulator__<> \
BOOST_JOIN(_accumulator_, __LINE__)_
( std::string(BOOST_CURRENT_FUNCTION) + ": " + \
- boost::chrono::stopwatch_accumulator_formatter::default_format() \
+ boost::chrono::__stopwatch_accumulator_formatter__::default_format() \
); \
- boost::chrono::stopclock_accumulator<>::scoped_run \
+ boost::chrono::__stopclock_accumulator__<>::scoped_run \
BOOST_JOIN(_accumulator_run_, __LINE__) \
(BOOST_JOIN(_accumulator_, __LINE__))
@@ -1142,12 +1143,12 @@
When you want to prefix with the `__FILE__[__LINE__]` pattern you can follow the same technique as described below:
#define REPORT_LINE_ACCUMULATED_LIFETIME \
- static stopclock_accumulator<>
+ static __stopclock_accumulator__<>
BOOST_JOIN(_accumulator_, __LINE__) \
( std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] "
- + stopwatch_accumulator_formatter::default_format() \
+ + __stopwatch_accumulator_formatter__::default_format() \
); \
- stopclock_accumulator<>::scoped_run \
+ __stopclock_accumulator__<>::scoped_run \
BOOST_JOIN(_accumulator_run_, __LINE__)
(BOOST_JOIN(_accumulator_, __LINE__))
@@ -1168,14 +1169,14 @@
[section Can I use an stopclock accumulator which is not static?]
-The typical example of stopclock_accumulator is to get statistical measures of the time a function takes for each one of its calls. You an also use stopclock_accumulator to get statistical measures of the time a given loop takes for each one of its laps.
+The typical example of stopclock_accumulator is to get statistical measures of the time a function takes for each one of its calls. You an also use __stopclock_accumulator__ to get statistical measures of the time a given loop takes for each one of its laps.
- stopclock_accumulator<> acc(
+ __stopclock_accumulator__<> acc(
std::string(__FILE__) + "[" + BOOST_STRINGIZE(__LINE__) + "] "
- + stopwatch_accumulator_formatter::default_format()
+ + __stopwatch_accumulator_formatter__::default_format()
);
for (int i=0; i<N; i++) {
- stopclock_accumulator<>::scoped_run _(acc);
+ __stopclock_accumulator__<>::scoped_run _(acc);
// ...
}
@@ -1193,10 +1194,10 @@
double res;
void f1(long j)
{
- stopwatch<>::reporter _(BOOST_CHRONO_STOPWATCH_FUNCTION_FORMAT);
+ __stopwatch__<>::reporter _(BOOST_CHRONO_STOPWATCH_FUNCTION_FORMAT);
for (long i =0; i< j; i+=1)
res+=std::sqrt( res+123.456L+i ); // burn some time
- stopwatch<>::reporter::scoped_suspend s(_);
+ __stopwatch__<>::reporter::scoped_suspend s(_);
boost::this_thread::sleep(boost::posix_time::milliseconds(200));
}
@@ -1213,8 +1214,8 @@
using namespace boost::accumulators;
- typedef stopwatch_accumulator<process_real_cpu_clock,
- accumulator_set<process_real_cpu_clock::rep,
+ typedef __stopwatch_accumulator__<__process_real_cpu_clock__,
+ accumulator_set<__process_real_cpu_clock__::rep,
features<
tag::count,
tag::sum,
@@ -1255,8 +1256,8 @@
...
#include <boost/accumulators/statistics/variance.hpp>
...
- typedef stopwatch_accumulator<process_real_cpu_clock,
- accumulator_set<process_real_cpu_clock::rep,
+ typedef __stopwatch_accumulator__<__process_real_cpu_clock__,
+ accumulator_set<__process_real_cpu_clock__::rep,
features<
tag::count,
tag::sum,
@@ -1268,8 +1269,8 @@
But what happens if we add new statistics to the accumulator_set that are not taken in account by the default formatter? These statistics will simply be ignored. So we will need to define our own accumulator formatter.
- typedef stopwatch_accumulator<process_real_cpu_clock,
- accumulator_set<process_real_cpu_clock::rep,
+ typedef __stopwatch_accumulator__<__process_real_cpu_clock__,
+ accumulator_set<__process_real_cpu_clock__::rep,
features<
tag::count,
tag::sum,
@@ -1420,8 +1421,8 @@
Sparse sampling of length units
typedef length<boost::__ratio__<1> > meter; // set meter as "unity"
- typedef length<boost::centi> centimeter; // 1/100 meter
- typedef length<boost::kilo> kilometer; // 1000 meters
+ typedef length<boost::__centi> centimeter; // 1/100 meter
+ typedef length<boost::__kilo> kilometer; // 1000 meters
typedef length<boost::__ratio__<254, 10000> > inch; // 254/10000 meters
length takes __ratio__ instead of two integral types so that definitions can be made like so:
@@ -1435,9 +1436,9 @@
Demo of (scientific) support for sub-nanosecond resolutions
- typedef boost::chrono::__duration__<double, boost::pico> picosecond; // 10^-12 seconds
- typedef boost::chrono::__duration__<double, boost::femto> femtosecond; // 10^-15 seconds
- typedef boost::chrono::__duration__<double, boost::atto> attosecond; // 10^-18 seconds
+ typedef boost::chrono::__duration__<double, boost::__pico> picosecond; // 10^-12 seconds
+ typedef boost::chrono::__duration__<double, boost::__femto> femtosecond; // 10^-15 seconds
+ typedef boost::chrono::__duration__<double, boost::__atto> attosecond; // 10^-18 seconds
A very brief proof-of-concept for SIUnits-like library. Hard-wired to floating point seconds and meters, but accepts other units.
@@ -1570,7 +1571,7 @@
std::cout << "* testUser1 *\n";
std::cout << "*************\n";
User1::Distance d( User1::mile(110) );
- User1::Time t( boost::chrono::hours(2) );
+ User1::Time t( boost::chrono::__hours(2) );
RR r=d / t;
//r.set(d.get() / t.get());
@@ -1608,7 +1609,7 @@
[endsect]
[endsect]
-[section Duation]
+[section Duration]
[/===============]
[section How you override the duration's default constructor]
@@ -1741,7 +1742,7 @@
A "saturating" signed integral type is developed. This type has +/- infinity and a nan (like IEEE floating point) but otherwise obeys signed integral arithmetic. This class is subsequently used as the rep in boost::chrono::__duration__ to demonstrate a duration class that does not silently ignore overflow.
-['See the source file [@../../example/satutating.cpp example/satutating.cpp]]
+['See the source file [@../../example/saturating.cpp example/saturating.cpp]]
[endsect]
@@ -1766,8 +1767,8 @@
template <long long speed>
struct cycle_count
{
- typedef typename boost::ratio_multiply<boost::__ratio__<speed>, boost::mega>::type frequency; // Mhz
- typedef typename boost::ratio_divide<boost::__ratio__<1>, frequency>::type period;
+ typedef typename boost::__ratio_multiply__<boost::__ratio__<speed>, boost::__mega>::type frequency; // Mhz
+ typedef typename boost::__ratio_divide__<boost::__ratio__<1>, frequency>::type period;
typedef long long rep;
typedef boost::chrono::__duration__<rep, period> duration;
typedef boost::chrono::__time_point__<cycle_count> time_point;
@@ -1984,8 +1985,8 @@
to_xtime_truncate(__duration__<Rep, Period> d)
{
xtime xt;
- xt.sec = static_cast<long>(duration_cast<seconds>(d).count());
- xt.usec = static_cast<long>(duration_cast<microseconds>(d - seconds(xt.sec)).count());
+ xt.sec = static_cast<long>(__duration_cast__<__seconds__>(d).count());
+ xt.usec = static_cast<long>(__duration_cast__<__microseconds__>(d - __seconds__(xt.sec)).count());
return xt;
}
@@ -1994,15 +1995,15 @@
to_xtime_round_up(__duration__<Rep, Period> d)
{
xtime xt;
- xt.sec = static_cast<long>(duration_cast<seconds>(d).count());
- xt.usec = static_cast<unsigned long>(round_up<microseconds>(d - seconds(xt.sec)).count());
+ xt.sec = static_cast<long>(__duration_cast__<__seconds__>(d).count());
+ xt.usec = static_cast<unsigned long>(round_up<__microseconds__>(d - __seconds__(xt.sec)).count());
return xt;
}
microseconds
from_xtime(xtime xt)
{
- return seconds(xt.sec) + microseconds(xt.usec);
+ return __seconds__(xt.sec) + __microseconds__(xt.usec);
}
void print(xtime xt)
@@ -2012,15 +2013,15 @@
Usage
- xtime xt = to_xtime_truncate(seconds(3) + milliseconds(251));
+ xtime xt = to_xtime_truncate(seconds(3) + __milliseconds__(251));
print(xt);
- milliseconds ms = duration_cast<milliseconds>(from_xtime(xt));
+ milliseconds ms = __duration_cast__<__milliseconds__>(from_xtime(xt));
std::cout << ms.count() << " milliseconds\n";
xt = to_xtime_round_up(ms);
print(xt);
- xt = to_xtime_truncate(seconds(3) + nanoseconds(999));
+ xt = to_xtime_truncate(seconds(3) + __nanoseconds__(999));
print(xt);
- xt = to_xtime_round_up(seconds(3) + nanoseconds(999));
+ xt = to_xtime_round_up(seconds(3) + __nanoseconds__(999));
print(xt);
@@ -2072,9 +2073,9 @@
int main()
{
- timer<system_clock> t1;
- timer<monotonic_clock> t2;
- timer<high_resolution_clock> t3;
+ timer<__system_clock__> t1;
+ timer<__monotonic_clock__> t2;
+ timer<__high_resolution_clock__> t3;
std::cout << "Strike any key: ";
std::cin.get();
@@ -2087,22 +2088,22 @@
std::cout << "high_resolution_clock--: "
<< t3.seconds() << " seconds\n";
- system_clock::time_point d4 = system_clock::now();
- system_clock::time_point d5 = system_clock::now();
+ __system_clock__::time_point d4 = __system_clock__::now();
+ __system_clock__::time_point d5 = __system_clock__::now();
std::cout << "\nsystem_clock latency-----------: " << (d5 - d4).count() << std::endl;
- monotonic_clock::time_point d6 = monotonic_clock::now();
- monotonic_clock::time_point d7 = monotonic_clock::now();
+ __monotonic_clock__::time_point d6 = __monotonic_clock__::now();
+ __monotonic_clock__::time_point d7 = __monotonic_clock__::now();
std::cout << "monotonic_clock latency--------: " << (d7 - d6).count() << std::endl;
- high_resolution_clock::time_point d8 = high_resolution_clock::now();
- high_resolution_clock::time_point d9 = high_resolution_clock::now();
+ __high_resolution_clock__::time_point d8 = __high_resolution_clock__::now();
+ __high_resolution_clock__::time_point d9 = __high_resolution_clock__::now();
std::cout << "high_resolution_clock latency--: " << (d9 - d8).count() << std::endl;
- std::time_t now = system_clock::to_time_t(system_clock::now());
+ std::time_t now = __system_clock__::to_time_t(__system_clock__::now());
std::cout << "\nsystem_clock::now() reports UTC is "
<< std::asctime(std::gmtime(&now)) << "\n";
@@ -2110,6 +2111,8 @@
return 0;
}
+The output of this program run looks like this:
+
['See the source file [@../../example/await_keystroke.cpp example/await_keystroke.cpp]]
[endsect]
@@ -2128,7 +2131,7 @@
int main()
{
- boost::chrono::stopclock<> t;
+ boost::chrono::__stopclock__<> t;
for ( long i = 0; i < 10000000; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -2160,7 +2163,7 @@
const char * format = argc > 1 ? argv[1] : "%t cpu seconds\n";
int places = argc > 2 ? std::atoi( argv[2] ) : 2;
- boost::chrono::stopclock<> t( format, places );
+ boost::chrono::__stopclock__<> t( format, places );
for ( long i = 0; i < 10000000; ++i )
std::sqrt( 123.456L ); // burn some time
@@ -2223,7 +2226,7 @@
if ( verbose )
{ std::cout << "command: \"" << s.c_str() << "\"\n"; }
- boost::chrono::stopclock<> t;
+ boost::chrono::__stopclock__<> t;
return std::system( s.c_str() );
}
@@ -2243,30 +2246,30 @@
namespace boost { namespace this_thread {
template <class Rep, class Period>
- void sleep_for(const boost::chrono::__duration__<Rep, Period>& d) {
- boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
+ void sleep_for(const chrono::__duration__<Rep, Period>& d) {
+ chrono::__microseconds__ t = chrono::__duration_cast__<chrono::__microseconds__>(d);
if (t < d)
++t;
- if (t > boost::chrono::microseconds(0))
+ if (t > chrono::__microseconds__(0))
std::cout << "sleep_for " << t.count() << " microseconds\n";
}
template <class Clock, class Duration>
- void sleep_until(const boost::chrono::__time_point__<Clock, Duration>& t) {
- using namespace boost::chrono;
+ void sleep_until(const chrono::__time_point__<Clock, Duration>& t) {
+ using namespace chrono;
typedef __time_point__<Clock, Duration> Time;
- typedef system_clock::time_point SysTime;
+ typedef __system_clock__::time_point SysTime;
if (t > Clock::now()) {
- typedef typename boost::__common_type__<typename Time::duration,
+ typedef typename __common_type__<typename Time::duration,
typename SysTime::duration>::type D;
/* auto */ D d = t - Clock::now();
- microseconds us = duration_cast<microseconds>(d);
+ microseconds us = __duration_cast__<__microseconds__>(d);
if (us < d)
++us;
- SysTime st = system_clock::now() + us;
+ SysTime st = __system_clock__::now() + us;
std::cout << "sleep_until ";
detail::print_time(st);
- std::cout << " which is " << (st - system_clock::now()).count() << " microseconds away\n";
+ std::cout << " which is " << (st - __system_clock__::now()).count() << " microseconds away\n";
}
}
@@ -2280,30 +2283,30 @@
// ...
template <class Rep, class Period>
- bool try_lock_for(const boost::chrono::__duration__<Rep, Period>& d) {
- boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
- if (t <= boost::chrono::microseconds(0))
+ bool try_lock_for(const chrono::__duration__<Rep, Period>& d) {
+ chrono::__microseconds__ t = chrono::__duration_cast__<chrono::__microseconds__>(d);
+ if (t <= chrono::__microseconds__(0))
return try_lock();
std::cout << "try_lock_for " << t.count() << " microseconds\n";
return true;
}
template <class Clock, class Duration>
- bool try_lock_until(const boost::chrono::__time_point__<Clock, Duration>& t)
+ bool try_lock_until(const chrono::__time_point__<Clock, Duration>& t)
{
- using namespace boost::chrono;
+ using namespace chrono;
typedef __time_point__<Clock, Duration> Time;
- typedef system_clock::time_point SysTime;
+ typedef __system_clock__::time_point SysTime;
if (t <= Clock::now())
return try_lock();
- typedef typename boost::__common_type__<typename Time::duration,
+ typedef typename __common_type__<typename Time::duration,
typename Clock::duration>::type D;
/* auto */ D d = t - Clock::now();
- microseconds us = duration_cast<microseconds>(d);
- SysTime st = system_clock::now() + us;
+ microseconds us = __duration_cast__<__microseconds__>(d);
+ SysTime st = __system_clock__::now() + us;
std::cout << "try_lock_until ";
detail::print_time(st);
- std::cout << " which is " << (st - system_clock::now()).count()
+ std::cout << " which is " << (st - __system_clock__::now()).count()
<< " microseconds away\n";
return true;
}
@@ -2318,27 +2321,27 @@
// ...
template <class Rep, class Period>
- bool wait_for(mutex&, const boost::chrono::__duration__<Rep, Period>& d) {
- boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
+ bool wait_for(mutex&, const chrono::__duration__<Rep, Period>& d) {
+ chrono::microseconds t = chrono::__duration_cast__<chrono::microseconds>(d);
std::cout << "wait_for " << t.count() << " microseconds\n";
return true;
}
template <class Clock, class Duration>
- bool wait_until(mutex&, const boost::chrono::__time_point__<Clock, Duration>& t) {
+ bool wait_until(mutex&, const chrono::__time_point__<Clock, Duration>& t) {
using namespace boost::chrono;
typedef __time_point__<Clock, Duration> Time;
- typedef system_clock::time_point SysTime;
+ typedef __system_clock__::time_point SysTime;
if (t <= Clock::now())
return false;
- typedef typename boost::__common_type__<typename Time::duration,
+ typedef typename __common_type__<typename Time::duration,
typename Clock::duration>::type D;
/* auto */ D d = t - Clock::now();
- microseconds us = duration_cast<microseconds>(d);
- SysTime st = system_clock::now() + us;
+ microseconds us = __duration_cast__<__microseconds__>(d);
+ SysTime st = __system_clock__::now() + us;
std::cout << "wait_until ";
detail::print_time(st);
- std::cout << " which is " << (st - system_clock::now()).count()
+ std::cout << " which is " << (st - __system_clock__::now()).count()
<< " microseconds away\n";
return true;
}
@@ -2354,20 +2357,20 @@
using namespace boost;
using namespace boost::chrono;
- this_thread::sleep_for(seconds(3));
- this_thread::sleep_for(nanoseconds(300));
- system_clock::time_point time_limit = system_clock::now() + seconds(4) + milliseconds(500);
+ this_thread::sleep_for(__seconds__(3));
+ this_thread::sleep_for(__nanoseconds__(300));
+ system_clock::time_point time_limit = __system_clock__::now() + __seconds_(4) + __milliseconds__(500);
this_thread::sleep_until(time_limit);
- mut.try_lock_for(milliseconds(30));
+ mut.try_lock_for(__milliseconds__(30));
mut.try_lock_until(time_limit);
- cv.wait_for(m, minutes(1)); // real code would put this in a loop
+ cv.wait_for(m, __minutes__(1)); // real code would put this in a loop
cv.wait_until(m, time_limit); // real code would put this in a loop
// For those who prefer floating point
this_thread::sleep_for(__duration__<double>(0.25));
- this_thread::sleep_until(system_clock::now() + __duration__<double>(1.5));
+ this_thread::sleep_until(__system_clock__::now() + __duration__<double>(1.5));
['See the source file [@../../example/simulated_thread_interface_demo.cpp example/simulated_thread_interface_demo.cpp]]
@@ -3003,7 +3006,7 @@
[section:duration Class template `duration<>`]
-A __duration__ measures time between two points in time (__time_point__). A __duration__ 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 `ratio`.
+A __duration__ measures time between two points in time (__time_point__). A __duration__ 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 __ratio__.
namespace boost { namespace chrono {
@@ -5740,7 +5743,7 @@
[/==================================]
-[section [*Version 0.4.5, June 26, 2010] ['Documentation update]]
+[section [*Version 0.4.5, July 6, 2010] ['Documentation update]]
[*Documentation]
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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -29,7 +29,7 @@
<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_4_5__june_26__2010____documentation_update_"><span class="bold"><strong>Version 0.4.5, June 26, 2010</strong></span> <span class="emphasis"><em>Documentation
+<dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_4_5__july_6__2010____documentation_update_"><span class="bold"><strong>Version 0.4.5, July 6, 2010</strong></span> <span class="emphasis"><em>Documentation
update</em></span></a></span></dt>
<dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_4_4__february_22__2010_____warning_fixes_"><span class="bold"><strong>Version 0.4.4, February 22, 2010</strong></span> <span class="emphasis"><em>Warning
fixes</em></span></a></span></dt>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -29,7 +29,7 @@
<a name="boost_chrono.appendices.faq"></a> Appendix D: FAQ
</h3></div></div></div>
<a name="boost_chrono.appendices.faq.how_important_is_the_order_of_the___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__lt__gt__template_arguments_"></a><h4>
-<a name="id4944873"></a>
+<a name="id4945521"></a>
<a href="faq.html#boost_chrono.appendices.faq.how_important_is_the_order_of_the___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__lt__gt__template_arguments_">How
important is the order of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><> template arguments?</a>
@@ -70,7 +70,7 @@
also undefined.
</p>
<a name="boost_chrono.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_clock_has_nanosecond_precision_"></a><h4>
-<a name="id4945427"></a>
+<a name="id4946075"></a>
<a href="faq.html#boost_chrono.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_clock_has_nanosecond_precision_">Why
does stopwatch_reporter only display millisecond place precision when the
underlying Clock has nanosecond precision?</a>
@@ -81,7 +81,7 @@
dangerously.
</p>
<a name="boost_chrono.appendices.faq.why_does_stopwatch_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_"></a><h4>
-<a name="id4945468"></a>
+<a name="id4946116"></a>
<a href="faq.html#boost_chrono.appendices.faq.why_does_stopwatch_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_">Why
does stopwatch_reporter sometimes report more cpu seconds than real seconds?</a>
</h4>
@@ -91,7 +91,7 @@
be reporting at times.
</p>
<a name="boost_chrono.appendices.faq.can_i_obtain_statistics_of_the_time_elapsed_between_calls_to_a_function_"></a><h4>
-<a name="id4945502"></a>
+<a name="id4946150"></a>
<a href="faq.html#boost_chrono.appendices.faq.can_i_obtain_statistics_of_the_time_elapsed_between_calls_to_a_function_">Can
I obtain statistics of the time elapsed between calls to a function?</a>
</h4>
@@ -99,13 +99,13 @@
The library do not provides this feature.
</p>
<a name="boost_chrono.appendices.faq.what_happens_if_i_press_ctrl_c_and_program_terminates__what_log_would_boost_chrono_output_"></a><h4>
-<a name="id4945530"></a>
+<a name="id4946178"></a>
<a href="faq.html#boost_chrono.appendices.faq.what_happens_if_i_press_ctrl_c_and_program_terminates__what_log_would_boost_chrono_output_">What
happens if I press Ctrl+C and program terminates? What log would Boost.chrono
output?</a>
</h4>
<a name="boost_chrono.appendices.faq.can_you_explain_the_pros_cons_of___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__against_boost_typeof_"></a><h4>
-<a name="id4945560"></a>
+<a name="id4946208"></a>
<a href="faq.html#boost_chrono.appendices.faq.can_you_explain_the_pros_cons_of___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__against_boost_typeof_">Can
you explain the pros/cons of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> against Boost.Typeof?</a>
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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -27,7 +27,7 @@
<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_4_5__june_26__2010____documentation_update_"><span class="bold"><strong>Version 0.4.5, June 26, 2010</strong></span> <span class="emphasis"><em>Documentation
+<dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_4_5__july_6__2010____documentation_update_"><span class="bold"><strong>Version 0.4.5, July 6, 2010</strong></span> <span class="emphasis"><em>Documentation
update</em></span></a></span></dt>
<dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_4_4__february_22__2010_____warning_fixes_"><span class="bold"><strong>Version 0.4.4, February 22, 2010</strong></span> <span class="emphasis"><em>Warning
fixes</em></span></a></span></dt>
@@ -52,8 +52,8 @@
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.appendices.history.__version_0_4_5__june_26__2010____documentation_update_"></a><a href="history.html#boost_chrono.appendices.history.__version_0_4_5__june_26__2010____documentation_update_" title="Version 0.4.5, June 26, 2010 Documentation
- update"><span class="bold"><strong>Version 0.4.5, June 26, 2010</strong></span> <span class="emphasis"><em>Documentation
+<a name="boost_chrono.appendices.history.__version_0_4_5__july_6__2010____documentation_update_"></a><a href="history.html#boost_chrono.appendices.history.__version_0_4_5__july_6__2010____documentation_update_" title="Version 0.4.5, July 6, 2010 Documentation
+ update"><span class="bold"><strong>Version 0.4.5, July 6, 2010</strong></span> <span class="emphasis"><em>Documentation
update</em></span></a>
</h4></div></div></div>
<p>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -69,7 +69,7 @@
with a variable lifetime.
</p>
<a name="boost_chrono.appendices.perf.single_threaded_recursive_function"></a><h4>
-<a name="id4949355"></a>
+<a name="id4950003"></a>
<a href="perf.html#boost_chrono.appendices.perf.single_threaded_recursive_function">Single-Threaded
Recursive function</a>
</h4>
@@ -92,7 +92,7 @@
and thread_clock.
</p>
<a name="boost_chrono.appendices.perf.multi_threaded_recursive_function"></a><h4>
-<a name="id4949405"></a>
+<a name="id4950053"></a>
<a href="perf.html#boost_chrono.appendices.perf.multi_threaded_recursive_function">Multi-Threaded
Recursive function</a>
</h4>
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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -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___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__to_a_function_with_the_units_being_ambiguous_"></a><h4>
-<a name="id4943505"></a>
+<a name="id4944152"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__to_a_function_with_the_units_being_ambiguous_">Is
it possible for the user to pass a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> to a function with the
@@ -46,7 +46,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="id4943604"></a>
+<a name="id4944252"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.why_duration_needs_operator_">Why
duration needs operator%</a>
</h4>
@@ -74,7 +74,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="id4944184"></a>
+<a name="id4944832"></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>
@@ -109,7 +109,7 @@
succeeds.
</p>
<a name="boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
-<a name="id4944593"></a>
+<a name="id4945241"></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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -26,7 +26,7 @@
<a name="boost_chrono.appendices.todo"></a> Appendix I: Future plans
</h3></div></div></div>
<a name="boost_chrono.appendices.todo.tasks_to_do_before_review"></a><h4>
-<a name="id4949472"></a>
+<a name="id4950120"></a>
<a href="todo.html#boost_chrono.appendices.todo.tasks_to_do_before_review">Tasks
to do before review</a>
</h4>
@@ -42,7 +42,7 @@
</li>
</ul></div>
<a name="boost_chrono.appendices.todo.for_later_releases"></a><h4>
-<a name="id4949511"></a>
+<a name="id4950159"></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/overview.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -164,7 +164,9 @@
<li>
<a href="reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span></code></a>
- shortcut of <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>></span></code>
+ shortcut of <code class="computeroutput"><a href="reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
+ Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a href="reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">>></span></code>
</li>
<li>
Allows wide characters
@@ -212,7 +214,7 @@
on C++03 compilers.
</p>
<a name="boost_chrono.overview.how_to_use_this_documentation"></a><h3>
-<a name="id4804262"></a>
+<a name="id4804281"></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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -27,7 +27,7 @@
<a name="boost_chrono.overview.motivation"></a>Motivation
</h3></div></div></div>
<a name="boost_chrono.overview.motivation.time"></a><h4>
-<a name="id4758557"></a>
+<a name="id4758575"></a>
<a href="motivation.html#boost_chrono.overview.motivation.time">Time</a>
</h4>
<p>
@@ -58,7 +58,7 @@
This documentation contains a lot of extracts from this document.
</p>
<a name="boost_chrono.overview.motivation.wall_clock_versus_system_and_user_time"></a><h4>
-<a name="id4758673"></a>
+<a name="id4758685"></a>
<a href="motivation.html#boost_chrono.overview.motivation.wall_clock_versus_system_and_user_time">Wall
clock versus system and user time</a>
</h4>
@@ -73,7 +73,7 @@
the times() function, while for Windows, it's the GetProcessTimes() function.
</p>
<a name="boost_chrono.overview.motivation.reporting_slapsed_time"></a><h4>
-<a name="id4758714"></a>
+<a name="id4758725"></a>
<a href="motivation.html#boost_chrono.overview.motivation.reporting_slapsed_time">Reporting
slapsed time</a>
</h4>
@@ -96,7 +96,7 @@
that can be invoked in a single line of code to report the usage of a Clock.
</p>
<a name="boost_chrono.overview.motivation.caveat_emptor"></a><h4>
-<a name="id4758838"></a>
+<a name="id4758849"></a>
<a href="motivation.html#boost_chrono.overview.motivation.caveat_emptor">Caveat emptor</a>
</h4>
<p>
@@ -108,7 +108,7 @@
the specific operating system is guaranteeing, which is often very little.
</p>
<a name="boost_chrono.overview.motivation.how_reliable_are_these_measures_"></a><h4>
-<a name="id4758868"></a>
+<a name="id4758879"></a>
<a href="motivation.html#boost_chrono.overview.motivation.how_reliable_are_these_measures_">How
reliable are these measures?</a>
</h4>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -1408,7 +1408,8 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> 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>.
+ It is expressed as a rational constant using <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>.
</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>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -1018,7 +1018,7 @@
<span class="special">}</span>
</pre>
<a name="boost_chrono.reference.reporters.scoped_stopclock_hpp.scoped_stopclock.synopsis"></a><h6>
-<a name="id4929292"></a>
+<a name="id4929940"></a>
<a href="reporters.html#boost_chrono.reference.reporters.scoped_stopclock_hpp.scoped_stopclock.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">process_cpu_clock</span>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -52,7 +52,7 @@
<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.common_type">Common
type</a></span></dt>
<dt><span class="section">Ratio</span></dt>
-<dt><span class="section">Duation</span></dt>
+<dt><span class="section">Duration</span></dt>
<dt><span class="section">Clocks</span></dt>
<dt><span class="section">Conversions</span></dt>
<dt><span class="section">Reporting</span></dt>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -33,12 +33,12 @@
utility</a></span></dt></dl></dd>
<dt><span class="section">Ratio</span></dt>
<dd><dl><dt><span class="section">SI-units</span></dt></dl></dd>
-<dt><span class="section">Duation</span></dt>
+<dt><span class="section">Duration</span></dt>
<dd><dl>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor">How
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.duration.how_you_override_the_duration_s_default_constructor">How
you override the duration's default constructor</a></span></dt>
-<dt><span class="section">runtime_resolution</span></dt>
-<dt><span class="section">Saturating</span></dt>
+<dt><span class="section">runtime_resolution</span></dt>
+<dt><span class="section">Saturating</span></dt>
</dl></dd>
<dt><span class="section">Clocks</span></dt>
<dd><dl>
@@ -159,8 +159,10 @@
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">meter</span><span class="special">;</span> <span class="comment">// set meter as "unity"
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">centi</span><span class="special">></span> <span class="identifier">centimeter</span><span class="special">;</span> <span class="comment">// 1/100 meter
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">kilo</span><span class="special">></span> <span class="identifier">kilometer</span><span class="special">;</span> <span class="comment">// 1000 meters
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">centi</span></code></a><span class="special">></span> <span class="identifier">centimeter</span><span class="special">;</span> <span class="comment">// 1/100 meter
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">kilo</span></code></a><span class="special">></span> <span class="identifier">kilometer</span><span class="special">;</span> <span class="comment">// 1000 meters
</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">254</span><span class="special">,</span> <span class="number">10000</span><span class="special">></span> <span class="special">></span> <span class="identifier">inch</span><span class="special">;</span> <span class="comment">// 254/10000 meters
</span></pre>
@@ -186,11 +188,14 @@
Demo of (scientific) support for sub-nanosecond resolutions
</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> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">pico</span><span class="special">></span> <span class="identifier">picosecond</span><span class="special">;</span> <span class="comment">// 10^-12 seconds
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">pico</span></code></a><span class="special">></span> <span class="identifier">picosecond</span><span class="special">;</span> <span class="comment">// 10^-12 seconds
</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">femto</span><span class="special">></span> <span class="identifier">femtosecond</span><span class="special">;</span> <span class="comment">// 10^-15 seconds
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a><span class="special">></span> <span class="identifier">femtosecond</span><span class="special">;</span> <span class="comment">// 10^-15 seconds
</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">atto</span><span class="special">></span> <span class="identifier">attosecond</span><span class="special">;</span> <span class="comment">// 10^-18 seconds
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a><span class="special">></span> <span class="identifier">attosecond</span><span class="special">;</span> <span class="comment">// 10^-18 seconds
</span></pre>
<p>
A very brief proof-of-concept for SIUnits-like library. Hard-wired to
@@ -350,7 +355,7 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"* testUser1 *\n"</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">"*************\n"</span><span class="special">;</span>
<span class="identifier">User1</span><span class="special">::</span><span class="identifier">Distance</span> <span class="identifier">d</span><span class="special">(</span> <span class="identifier">User1</span><span class="special">::</span><span class="identifier">mile</span><span class="special">(</span><span class="number">110</span><span class="special">)</span> <span class="special">);</span>
- <span class="identifier">User1</span><span class="special">::</span><span class="identifier">Time</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">hours</span><span class="special">(</span><span class="number">2</span><span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">User1</span><span class="special">::</span><span class="identifier">Time</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">__hours</span><span class="special">(</span><span class="number">2</span><span class="special">)</span> <span class="special">);</span>
<span class="identifier">RR</span> <span class="identifier">r</span><span class="special">=</span><span class="identifier">d</span> <span class="special">/</span> <span class="identifier">t</span><span class="special">;</span>
<span class="comment">//r.set(d.get() / t.get());
@@ -390,17 +395,17 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.duation"></a>Duation
+<a name="boost_chrono.users_guide.examples.duration"></a>Duration
</h4></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor">How
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.duration.how_you_override_the_duration_s_default_constructor">How
you override the duration's default constructor</a></span></dt>
-<dt><span class="section">runtime_resolution</span></dt>
-<dt><span class="section">Saturating</span></dt>
+<dt><span class="section">runtime_resolution</span></dt>
+<dt><span class="section">Saturating</span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor"></a><a href="examples.html#boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor" title="How
+<a name="boost_chrono.users_guide.examples.duration.how_you_override_the_duration_s_default_constructor"></a><a href="examples.html#boost_chrono.users_guide.examples.duration.how_you_override_the_duration_s_default_constructor" title="How
you override the duration's default constructor">How
you override the duration's default constructor</a>
</h5></div></div></div>
@@ -478,7 +483,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.users_guide.examples.duation.runtime_resolution"></a>runtime_resolution
+<a name="boost_chrono.users_guide.examples.duration.runtime_resolution"></a>runtime_resolution
</h5></div></div></div>
<p>
Handle duration with resolution not known until run time
@@ -543,7 +548,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.users_guide.examples.duation.saturating"></a>Saturating
+<a name="boost_chrono.users_guide.examples.duration.saturating"></a>Saturating
</h5></div></div></div>
<p>
A "saturating" signed integral type is developed. This type
@@ -554,7 +559,7 @@
class that does not silently ignore overflow.
</p>
<p>
- <span class="emphasis"><em>See the source file example/satutating.cpp</em></span>
+ <span class="emphasis"><em>See the source file example/saturating.cpp</em></span>
</p>
</div>
</div>
@@ -598,9 +603,10 @@
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">speed</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">cycle_count</span>
<span class="special">{</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">speed</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mega</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">frequency</span><span class="special">;</span> <span class="comment">// Mhz
-</span> <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">__ratio_multiply__</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">speed</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">mega</span></code></a><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">frequency</span><span class="special">;</span> <span class="comment">// Mhz
+</span> <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">__ratio_divide__</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">frequency</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">period</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">rep</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> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
@@ -836,8 +842,13 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">{</span>
<span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">;</span>
- <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">seconds</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="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
<span class="keyword">return</span> <span class="identifier">xt</span><span class="special">;</span>
<span class="special">}</span>
@@ -847,15 +858,21 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">{</span>
<span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">;</span>
- <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">seconds</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="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">>(</span><span class="identifier">round_up</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">>(</span><span class="identifier">round_up</span><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
<span class="keyword">return</span> <span class="identifier">xt</span><span class="special">;</span>
<span class="special">}</span>
<span class="identifier">microseconds</span>
<span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">)</span>
<span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">microseconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span><span class="special">);</span>
+ <span class="keyword">return</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span><span class="special">);</span>
<span class="special">}</span>
<span class="keyword">void</span> <span class="identifier">print</span><span class="special">(</span><span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">)</span>
@@ -866,15 +883,20 @@
<p>
Usage
</p>
-<pre class="programlisting"><span class="identifier">xtime</span> <span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">milliseconds</span><span class="special">(</span><span class="number">251</span><span class="special">));</span>
+<pre class="programlisting"><span class="identifier">xtime</span> <span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a><span class="special">(</span><span class="number">251</span><span class="special">));</span>
<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-<span class="identifier">milliseconds</span> <span class="identifier">ms</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">milliseconds</span><span class="special">>(</span><span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xt</span><span class="special">));</span>
+<span class="identifier">milliseconds</span> <span class="identifier">ms</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a><span class="special">>(</span><span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xt</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="identifier">ms</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" milliseconds\n"</span><span class="special">;</span>
<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">ms</span><span class="special">);</span>
<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">999</span><span class="special">));</span>
+<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a><span class="special">(</span><span class="number">999</span><span class="special">));</span>
<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">999</span><span class="special">));</span>
+<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a><span class="special">(</span><span class="number">999</span><span class="special">));</span>
<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
</pre>
<p>
@@ -927,9 +949,12 @@
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="identifier">timer</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">></span> <span class="identifier">t1</span><span class="special">;</span>
- <span class="identifier">timer</span><span class="special"><</span><span class="identifier">monotonic_clock</span><span class="special">></span> <span class="identifier">t2</span><span class="special">;</span>
- <span class="identifier">timer</span><span class="special"><</span><span class="identifier">high_resolution_clock</span><span class="special">></span> <span class="identifier">t3</span><span class="special">;</span>
+ <span class="identifier">timer</span><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">></span> <span class="identifier">t1</span><span class="special">;</span>
+ <span class="identifier">timer</span><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a><span class="special">></span> <span class="identifier">t2</span><span class="special">;</span>
+ <span class="identifier">timer</span><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">></span> <span class="identifier">t3</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">"Strike any key: "</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cin</span><span class="special">.</span><span class="identifier">get</span><span class="special">();</span>
@@ -942,22 +967,36 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"high_resolution_clock--: "</span>
<span class="special"><<</span> <span class="identifier">t3</span><span class="special">.</span><span class="identifier">seconds</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" seconds\n"</span><span class="special">;</span>
- <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d4</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d5</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d4</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d5</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</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">"\nsystem_clock latency-----------: "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">d5</span> <span class="special">-</span> <span class="identifier">d4</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d6</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d7</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d6</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d7</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a><span class="special">::</span><span class="identifier">now</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">"monotonic_clock latency--------: "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">d7</span> <span class="special">-</span> <span class="identifier">d6</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">high_resolution_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d8</span> <span class="special">=</span> <span class="identifier">high_resolution_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">high_resolution_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d9</span> <span class="special">=</span> <span class="identifier">high_resolution_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d8</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">d9</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">::</span><span class="identifier">now</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">"high_resolution_clock latency--: "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">d9</span> <span class="special">-</span> <span class="identifier">d8</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">now</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">to_time_t</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">());</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">now</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">to_time_t</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</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">"\nsystem_clock::now() reports UTC is "</span>
<span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">asctime</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">gmtime</span><span class="special">(&</span><span class="identifier">now</span><span class="special">))</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
@@ -966,6 +1005,9 @@
<span class="special">}</span>
</pre>
<p>
+ The output of this program run looks like this:
+ </p>
+<p>
<span class="emphasis"><em>See the source file example/await_keystroke.cpp</em></span>
</p>
</div>
@@ -988,7 +1030,8 @@
<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">stopclock</span><span class="special"><></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><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10000000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
@@ -1027,7 +1070,8 @@
<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">stopclock</span><span class="special"><></span> <span class="identifier">t</span><span class="special">(</span> <span class="identifier">format</span><span class="special">,</span> <span class="identifier">places</span> <span class="special">);</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">(</span> <span class="identifier">format</span><span class="special">,</span> <span class="identifier">places</span> <span class="special">);</span>
<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10000000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
@@ -1095,7 +1139,8 @@
<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">stopclock</span><span class="special"><></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><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
<span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">system</span><span class="special">(</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">()</span> <span class="special">);</span>
<span class="special">}</span>
@@ -1122,34 +1167,43 @@
<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">this_thread</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">void</span> <span class="identifier">sleep_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+<span class="keyword">void</span> <span class="identifier">sleep_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</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">duration_cast</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">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">chrono</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">++</span><span class="identifier">t</span><span class="special">;</span>
- <span class="keyword">if</span> <span class="special">(</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">microseconds</span><span class="special">(</span><span class="number">0</span><span class="special">))</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special">></span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">(</span><span class="number">0</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">"sleep_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</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">Duration</span><span class="special">></span>
-<span class="keyword">void</span> <span class="identifier">sleep_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+<span class="keyword">void</span> <span class="identifier">sleep_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><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="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span><span class="special">;</span>
<span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><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">Time</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special">></span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span> <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
<span class="keyword">typename</span> <span class="identifier">SysTime</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
<span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">us</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">++</span><span class="identifier">us</span><span class="special">;</span>
- <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</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">"sleep_until "</span><span class="special">;</span>
<span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</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">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds away\n"</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">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
@@ -1163,34 +1217,43 @@
<span class="comment">// ...
</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">bool</span> <span class="identifier">try_lock_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ <span class="keyword">bool</span> <span class="identifier">try_lock_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</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">duration_cast</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">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</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">microseconds</span><span class="special">(</span><span class="number">0</span><span class="special">))</span>
+ <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">chrono</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">(</span><span class="number">0</span><span class="special">))</span>
<span class="keyword">return</span> <span class="identifier">try_lock</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">"try_lock_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
<span class="keyword">return</span> <span class="keyword">true</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">Duration</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="identifier">try_lock_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ <span class="keyword">bool</span> <span class="identifier">try_lock_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><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="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span><span class="special">;</span>
<span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><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">Time</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span>
<span class="keyword">return</span> <span class="identifier">try_lock</span><span class="special">();</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</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="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
<span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</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">"try_lock_until "</span><span class="special">;</span>
<span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</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">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</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">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
<span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
<span class="special">}</span>
@@ -1206,31 +1269,37 @@
<span class="comment">// ...
</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">bool</span> <span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ <span class="keyword">bool</span> <span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</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">duration_cast</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">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">chrono</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</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">"wait_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
<span class="keyword">return</span> <span class="keyword">true</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">Duration</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ <span class="keyword">bool</span> <span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><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="special">{</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
<span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><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">Time</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span>
<span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</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="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
<span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</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">"wait_until "</span><span class="special">;</span>
<span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</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">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</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">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
<span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
<span class="special">}</span>
@@ -1247,21 +1316,28 @@
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">300</span><span class="special">));</span>
-<span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">time_limit</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">seconds</span><span class="special">(</span><span class="number">4</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">milliseconds</span><span class="special">(</span><span class="number">500</span><span class="special">);</span>
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a><span class="special">(</span><span class="number">300</span><span class="special">));</span>
+<span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">time_limit</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">__seconds_</span><span class="special">(</span><span class="number">4</span><span class="special">)</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a><span class="special">(</span><span class="number">500</span><span class="special">);</span>
<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span><span class="identifier">time_limit</span><span class="special">);</span>
-<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_for</span><span class="special">(</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">30</span><span class="special">));</span>
+<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_for</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a><span class="special">(</span><span class="number">30</span><span class="special">));</span>
<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_until</span><span class="special">(</span><span class="identifier">time_limit</span><span class="special">);</span>
-<span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">m</span><span class="special">,</span> <span class="identifier">minutes</span><span class="special">(</span><span class="number">1</span><span class="special">));</span> <span class="comment">// real code would put this in a loop
+<span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">m</span><span class="special">,</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a><span class="special">(</span><span class="number">1</span><span class="special">));</span> <span class="comment">// real code would put this in a loop
</span><span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">m</span><span class="special">,</span> <span class="identifier">time_limit</span><span class="special">);</span> <span class="comment">// real code would put this in a loop
</span>
<span class="comment">// For those who prefer floating point
</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">0.25</span><span class="special">));</span>
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">1.5</span><span class="special">));</span>
</pre>
<p>
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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -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="id4759219"></a>
+<a name="id4759218"></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>
@@ -54,7 +54,7 @@
and follow the instructions there for anonymous SVN access.
</p>
<a name="boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___"></a><h5>
-<a name="id4759289"></a>
+<a name="id4759288"></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>
@@ -70,7 +70,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="id4759331"></a>
+<a name="id4759330"></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>
@@ -81,7 +81,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="id4759403"></a>
+<a name="id4759401"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.requirements">Requirements</a>
</h5>
<p>
@@ -144,7 +144,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="id4759659"></a>
+<a name="id4759657"></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>
@@ -154,7 +154,7 @@
with the Boost System library.
</p>
<a name="boost_chrono.users_guide.getting_started.install.exceptions_safety_"></a><h5>
-<a name="id4759693"></a>
+<a name="id4759692"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.exceptions_safety_">Exceptions
safety </a>
</h5>
@@ -163,7 +163,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="id4759721"></a>
+<a name="id4759719"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.thread_safety_">Thread
safety </a>
</h5>
@@ -171,7 +171,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="id4759746"></a>
+<a name="id4759745"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.tested_compilers_">Tested
compilers </a>
</h5>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -73,8 +73,6 @@
<dd><dl>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.stopwatches_accumulation_and_statistics">Stopwatches
accumulation and statistics</a></span></dt>
-<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_">How
- reliable are these measures?</a></span></dt>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_">How
can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
function signature?</a></span></dt>
@@ -231,9 +229,10 @@
</span><span class="keyword">typedef</span> <span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">five_thirds</span><span class="special">,</span> <span class="identifier">also_five_thirds</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">one</span><span class="special">;</span> <span class="comment">// one::num == 1, one::den == 1
</span></pre>
<p>
- This facility also includes convenience typedefs for the SI prefixes <code class="computeroutput"><span class="identifier">atto</span></code> through <code class="computeroutput"><span class="identifier">exa</span></code>
- corresponding to their internationally recognized definitions (in terms
- of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ This facility also includes convenience typedefs for the SI prefixes <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a> through <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">exa</span></code></a> corresponding to their internationally
+ recognized definitions (in terms of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>). This is a tremendous syntactic
convenience. It will prevent errors in specifying constants as one no longer
has to double count the number of zeros when trying to write million or
@@ -303,19 +302,23 @@
the most common units used when sleeping, waiting on a condition variable,
or waiting to obtain the lock on a mutex. Each of these units is nothing
but a thin wrapper around a signed integral count. That is, when you construct
- <code class="computeroutput"><span class="identifier">minutes</span><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>, all that
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a><code class="computeroutput"><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>, all that
happens is a <code class="computeroutput"><span class="number">3</span></code> is stored inside
- of minutes. When you construct <code class="computeroutput"><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>,
- all that happens is a <code class="computeroutput"><span class="number">3</span></code> is
- stored inside of microseconds.
+ of minutes. When you construct <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><code class="computeroutput"><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>, all that
+ happens is a <code class="computeroutput"><span class="number">3</span></code> is stored inside
+ of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a>.
</p>
<p>
The only context in which these different types differ is when being converted
to one another. At this time, unit-specific compile-time conversion constants
are used to convert the source unit to the target unit. Only conversions
from coarser units to finer units are allowed (in boost). This restriction
- ensures that all conversions are always exact. That is, <code class="computeroutput"><span class="identifier">microseconds</span></code>
- can always represent any value <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ ensures that all conversions are always exact. That is, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a> can always represent
+ any value <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a> has.
</p>
<p>
@@ -344,14 +347,14 @@
the precision, so as long as the precision can be expressed by a rational
constant with respect to seconds, this framework can exactly represent
it (one third of a second is no problem, and neither is one third of a
- <code class="computeroutput"><span class="identifier">femto</span></code> second). All of this
- utility and flexibility comes at no cost just by making use of the no-run-time-overhead
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a> second). All of this utility
+ and flexibility comes at no cost just by making use of the no-run-time-overhead
<a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> facility.
</p>
<p>
- In Boost.DateTime, <code class="computeroutput"><span class="identifier">hours</span></code>
- does not have the same representation as <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ In Boost.DateTime, __hours does not have the same representation as <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a>. The former is usually
represented with a <code class="computeroutput"><span class="keyword">long</span></code> whereas
a <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">long</span></code>
@@ -369,8 +372,7 @@
The six predefined units all use signed integral types as their representation.
And they all have a minimum range of +/- 292 years. <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> needs 64 bits to cover
- that range. <code class="computeroutput"><span class="identifier">hours</span></code> needs
- only 23 bits to cover that range.
+ that range. __hours needs only 23 bits to cover that range.
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
@@ -467,7 +469,7 @@
fractional part gets silently discarded.
</p>
<a name="boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__to__minutes__instead_of__microseconds__.but_what_if_the_truncation_behavior_is_what_i_want_to_do_"></a><h6>
-<a name="id4816093"></a>
+<a name="id4816124"></a>
<a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__to__minutes__instead_of__microseconds__.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>
</h6>
@@ -916,19 +918,24 @@
<p>
You can use <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><code class="computeroutput"><span class="special"><></span></code>
- to convert the <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code>
- into whatever units you desire. This facility will round down (truncate)
- if an exact conversion is not possible. Ex:
- </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">milliseconds</span> <span class="identifier">ms</span><span class="special">;</span>
-<span class="identifier">ms</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ms</span><span class="special">>(</span><span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">);</span>
+ to convert the <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><code class="computeroutput"><span class="special">::</span><span class="identifier">duration</span></code> into whatever units you desire.
+ This facility will round down (truncate) if an exact conversion is not
+ possible. Ex:
+ </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> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a> <span class="identifier">ms</span><span class="special">;</span>
+<span class="identifier">ms</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">ms</span><span class="special">>(</span><span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">);</span>
<span class="comment">// d now holds the number of milliseconds from start to end.
</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">ms</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"ms\n"</span><span class="special">;</span>
</pre>
<p>
- As <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code> is nanoseconds, we can convert
+ As <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><span class="special">::</span><span class="identifier">duration</span></code> is <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a>, we can convert
to <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a>, or some integral-based
duration which <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
@@ -937,7 +944,8 @@
Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><code class="computeroutput"><span class="special"><></span></code>
is unnecessary:
</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">nanoseconds</span> <span class="identifier">ns</span><span class="special">;</span>
+<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> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> <span class="identifier">ns</span><span class="special">;</span>
<span class="identifier">ns</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</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="identifier">ns</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"ns\n"</span><span class="special">;</span>
</pre>
@@ -958,16 +966,20 @@
Else it will not compile.
</p>
<p>
- If you would like to programmatically inspect <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code>,
- you can get the representation type with <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">rep</span></code>,
- and the tick period with <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">period</span></code>
- (which should be a type <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ If you would like to programmatically inspect <code class="computeroutput"><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><span class="special">::</span><span class="identifier">duration</span></code>, you can get the representation
+ type with <code class="computeroutput"><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><span class="special">::</span><span class="identifier">rep</span></code>, and the tick period with <code class="computeroutput"><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><span class="special">::</span><span class="identifier">period</span></code> (which should be a type <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> which has nested values
<code class="computeroutput"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">::</span><span class="identifier">num</span></code> and <code class="computeroutput"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">::</span><span class="identifier">den</span></code>). The tick period of <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
- Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> is <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">period</span><span class="special">::</span><span class="identifier">num</span> <span class="special">/</span> <span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">period</span><span class="special">::</span><span class="identifier">den</span></code> seconds: 1/1000000000 in this case
- (1 billionth of a second), stored in a long long.
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> is <code class="computeroutput"><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><span class="special">::</span><span class="identifier">period</span><span class="special">::</span><span class="identifier">num</span> <span class="special">/</span> <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a><span class="special">::</span><span class="identifier">period</span><span class="special">::</span><span class="identifier">den</span></code> seconds: 1/1000000000 in this case
+ (<code class="computeroutput"><span class="number">1</span></code> billionth of a second),
+ stored in a <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">long</span></code>.
</p>
<p>
If you need to use <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
@@ -982,13 +994,15 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">// first round down
-</span> <span class="identifier">ToDuration</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+</span> <span class="identifier">ToDuration</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
<span class="keyword">if</span> <span class="special">(</span><span class="identifier">result</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span> <span class="comment">// comparisons are *always* exact
</span> <span class="special">++</span><span class="identifier">result</span><span class="special">;</span> <span class="comment">// increment by one tick period
</span> <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</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">milliseconds</span> <span class="identifier">ms</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> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a> <span class="identifier">ms</span><span class="special">;</span>
<span class="identifier">ms</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">round_up</span><span class="special"><</span><span class="identifier">ms</span><span class="special">>(</span><span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">);</span>
<span class="comment">// d now holds the number of milliseconds from start to end, rounded up.
</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">ms</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"ms\n"</span><span class="special">;</span>
@@ -1004,8 +1018,6 @@
<div class="toc"><dl>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.stopwatches_accumulation_and_statistics">Stopwatches
accumulation and statistics</a></span></dt>
-<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_">How
- reliable are these measures?</a></span></dt>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_">How
can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
function signature?</a></span></dt>
@@ -1023,8 +1035,10 @@
is useful in both test and production environments. <span class="bold"><strong>Boost.Chrono</strong></span>
introduces the <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> concept which captures
- the mechanism to measure the elapsed time. A Stopwatch allows to start,
- stop, suspend and resume the measure of the eleapsed time. <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ the mechanism to measure the elapsed time. A <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
+ Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> allows to <code class="computeroutput"><span class="identifier">start</span></code>, <code class="computeroutput"><span class="identifier">stop</span></code>,
+ <code class="computeroutput"><span class="identifier">suspend</span></code> and <code class="computeroutput"><span class="identifier">resume</span></code> the measure of the eleapsed time.
+ <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>
is the basic model of <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> allowing to make a single
@@ -1034,12 +1048,15 @@
At the user level, the main use case of measuring the elapsed time is to
report these measures on the display. <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><code class="computeroutput"><span class="special"><></span></code> provides a run time reporting package
- that can be invoked in a single line of code to report the usage of a Clock.
- For example
+ that can be invoked in a single line of code to report the usage of a
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock" title="
+ Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>. 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="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+ <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
+ Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
@@ -1080,8 +1097,12 @@
</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_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">sw</span><span class="special">;</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">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">sw</span><span class="special">);</span>
+ <span class="keyword">static</span> <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
+ Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><></span> <span class="special">></span> <span class="identifier">sw</span><span class="special">;</span>
+ <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
+ Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><span class="special"><</span><a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><></span> <span class="special">>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">sw</span><span class="special">);</span>
<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
@@ -1101,111 +1122,6 @@
<pre class="programlisting"><span class="number">3</span> <span class="identifier">times</span><span class="special">,</span> <span class="identifier">sum</span><span class="special">=</span><span class="number">0.034</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">min</span><span class="special">=</span><span class="number">0.006</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">max</span><span class="special">=</span><span class="number">0.017</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">mean</span><span class="special">=</span><span class="number">0.011</span><span class="identifier">s</span>
</pre>
</div>
-<p>
- [
- </p>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_" title="How
- reliable are these measures?">How
- reliable are these measures?</a>
-</h5></div></div></div>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- this section need to be reworked, the ideas are there, but ...
- </p></td></tr>
-</table></div>
-<p>
- There are three context on which you can get unreliable measures:
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- Precission of your clock. If the precission of your clock is 10ms you
- can not be able to measure the time spent by blocks of code that takes
- the same order of magnitude. The library provides a hig_resolution_clock
- that gives you the higher resolution available on your platform. Respect
- to the precission, nothing to do except to take the clock with the
- highest resolution and measures blocks of code that will spent time
- having more than one order of magnitude the precission of the clock.
- </li></ul></div>
-<p>
-
-</p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
- <span class="special">...</span>
- <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">high_resolution_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-</pre>
-<p>
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- When your application is multithreaded, and you use a process clock,
- the time you get is the delay during which your block has been executed,
- in concurrency with the other threads of execution. If what you want
- is the time spent by this specific thread another clock is needed.
- The library provide a <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
- Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> that returns
- the time spent by the thread on platforms providing this kind of data.
- It can be used as follows
- </li></ul></div>
-<p>
-
-</p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">thread_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="special">...</span>
-<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
- <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-<span class="preprocessor">#else</span>
- <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-<span class="preprocessor">#endif</span>
-</pre>
-<p>
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- Nested stopclocks (usually nested function calls where each function
- contains a stopclock). When the nesting is deep enough, the cumulative
- overhead of all the stopclock functionality make the data unreliable
- except for the inner-most trace points. The question is, how much time
- is related to the application code we want to measure and how much
- to the fact we are meassuring and logging in inner blocks?
- </li></ul></div>
-<p>
- Some measures let us think that most of the time spent by the stopclock
- mechanism is associated to the logging part. There are two things we
- can do to make the difference :
- </p>
-<div class="itemizedlist"><ul type="disc">
-<li>
- Avoid expensive operations as logging while doing the measures. Note
- that reporting in itself is not too expensive as far as we don't need
- to flush the buffer. This can be achieved either using a stopclock
- accumulator, 'i.e. don't report until all the measures have been compiled
- and then report some statistics or using an asynchronous stream.
- </li>
-<li>
- Introduce some cheap mechanism that allows us to make the difference
- between the application time and the intrinsec stopclock time. When
- the precission of the clock is enough, we can suspend the counting
- of the Clock while we are spending time reporting the measures, and
- resume it once the work is done. The library provide a Clock wrapper
- <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="
- Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a> that make
- the resulting clock suspendible. The stopwatch_reporter is able to
- detect if the CLock is Suspendible and then suspend/resume the clock
- while doing the report.
- </li>
-</ul></div>
-<pre class="programlisting"><span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-</pre>
-<p>
- See the performances section for more deep details.
- </p>
-</div>
-<p>
- ]
- </p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_" title="How
@@ -1215,30 +1131,37 @@
function signature?</a>
</h5></div></div></div>
<p>
- You will need to give a specific format to your stopclock. You just need
- to concatenate your specific pattern to the default_format of the formatter.
+ You will need to give a specific format to your <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a>. You just need to
+ concatenate your specific pattern to the default_format of the formatter.
</p>
<p>
- For example, for a stopclock_accumulator the default formatter is stopwatch_accumulator_formatter,
+ For example, for a <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a> the default
+ formatter is __stopwatch_accumulator<span class="underline">formatter</span>_,
you will need to do something like:
</p>
-<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">stopclock_accumulator</span><span class="special"><></span> <span class="identifier">acc</span><span class="special">(</span>
+<pre class="programlisting"><span class="keyword">static</span> <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span> <span class="identifier">acc</span><span class="special">(</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">BOOST_CURRENT_FUNCTION</span><span class="special">)</span> <span class="special">+</span> <span class="string">": "</span>
- <span class="special">+</span> <span class="identifier">stopwatch_accumulator_formatter</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span>
+ <span class="special">+</span> <span class="identifier">__stopwatch_accumulator_formatter__</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span>
<span class="special">);</span>
-<span class="identifier">stopclock_accumulator</span><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+<a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
</pre>
<p>
Some of you will say that this is too long to type just to get the a
report. You can of course define your own macro as
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">REPORT_FUNCTION_ACCUMULATED_LIFETIME</span><span class="special">\</span>
- <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><></span> <span class="special">\</span>
+ <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span> <span class="special">\</span>
<span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span><span class="identifier">_</span>
<span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">BOOST_CURRENT_FUNCTION</span><span class="special">)</span> <span class="special">+</span> <span class="string">": "</span> <span class="special">+</span> <span class="special">\</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator_formatter</span><span class="special">::</span><span class="identifier">default_format</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">__stopwatch_accumulator_formatter__</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span> <span class="special">\</span>
<span class="special">);</span> <span class="special">\</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="special">\</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="special">\</span>
<span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_run_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">\</span>
<span class="special">(</span><span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">))</span>
</pre>
@@ -1264,12 +1187,14 @@
as described below:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">REPORT_LINE_ACCUMULATED_LIFETIME</span> <span class="special">\</span>
- <span class="keyword">static</span> <span class="identifier">stopclock_accumulator</span><span class="special"><></span>
+ <span class="keyword">static</span> <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span>
<span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">\</span>
<span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"["</span> <span class="special">+</span> <span class="identifier">BOOST_STRINGIZE</span><span class="special">(</span><span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"] "</span>
- <span class="special">+</span> <span class="identifier">stopwatch_accumulator_formatter</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span> <span class="special">\</span>
+ <span class="special">+</span> <span class="identifier">__stopwatch_accumulator_formatter__</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span> <span class="special">\</span>
<span class="special">);</span> <span class="special">\</span>
- <span class="identifier">stopclock_accumulator</span><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="special">\</span>
+ <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="special">\</span>
<span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_run_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">)</span>
<span class="special">(</span><span class="identifier">BOOST_JOIN</span><span class="special">(</span><span class="identifier">_accumulator_</span><span class="special">,</span> <span class="identifier">__LINE__</span><span class="special">))</span>
</pre>
@@ -1297,15 +1222,19 @@
<p>
The typical example of stopclock_accumulator is to get statistical measures
of the time a function takes for each one of its calls. You an also use
- stopclock_accumulator to get statistical measures of the time a given
- loop takes for each one of its laps.
+ <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a> to get
+ statistical measures of the time a given loop takes for each one of its
+ laps.
</p>
-<pre class="programlisting"><span class="identifier">stopclock_accumulator</span><span class="special"><></span> <span class="identifier">acc</span><span class="special">(</span>
+<pre class="programlisting"><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><></span> <span class="identifier">acc</span><span class="special">(</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">(</span><span class="identifier">__FILE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"["</span> <span class="special">+</span> <span class="identifier">BOOST_STRINGIZE</span><span class="special">(</span><span class="identifier">__LINE__</span><span class="special">)</span> <span class="special">+</span> <span class="string">"] "</span>
- <span class="special">+</span> <span class="identifier">stopwatch_accumulator_formatter</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span>
+ <span class="special">+</span> <span class="identifier">__stopwatch_accumulator_formatter__</span><span class="special">::</span><span class="identifier">default_format</span><span class="special">()</span>
<span class="special">);</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special"><</span><span class="identifier">N</span><span class="special">;</span> <span class="identifier">i</span><span class="special">++)</span> <span class="special">{</span>
- <span class="identifier">stopclock_accumulator</span><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
+ <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator" title="
+ Template Class stopclock_accumulator<>"><code class="computeroutput"><span class="identifier">stopclock_accumulator</span></code></a><span class="special"><>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">acc</span><span class="special">);</span>
<span class="comment">// ...
</span><span class="special">}</span>
</pre>
@@ -1325,10 +1254,12 @@
<span class="keyword">double</span> <span class="identifier">res</span><span class="special">;</span>
<span class="keyword">void</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span>
<span class="special">{</span>
- <span class="identifier">stopwatch</span><span class="special"><>::</span><span class="identifier">reporter</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_STOPWATCH_FUNCTION_FORMAT</span><span class="special">);</span>
+ <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><>::</span><span class="identifier">reporter</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_STOPWATCH_FUNCTION_FORMAT</span><span class="special">);</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="identifier">i</span><span class="special">+=</span><span class="number">1</span><span class="special">)</span>
<span class="identifier">res</span><span class="special">+=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="identifier">res</span><span class="special">+</span><span class="number">123.456L</span><span class="special">+</span><span class="identifier">i</span> <span class="special">);</span> <span class="comment">// burn some time
-</span> <span class="identifier">stopwatch</span><span class="special"><>::</span><span class="identifier">reporter</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">s</span><span class="special">(</span><span class="identifier">_</span><span class="special">);</span>
+</span> <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><span class="special"><>::</span><span class="identifier">reporter</span><span class="special">::</span><span class="identifier">scoped_suspend</span> <span class="identifier">s</span><span class="special">(</span><span class="identifier">_</span><span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">200</span><span class="special">));</span>
<span class="special">}</span>
</pre>
@@ -1359,8 +1290,11 @@
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">accumulators</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span>
- <span class="identifier">accumulator_set</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+<span class="keyword">typedef</span> <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a><span class="special">,</span>
+ <span class="identifier">accumulator_set</span><span class="special"><</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
<span class="identifier">features</span><span class="special"><</span>
<span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
<span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
@@ -1411,8 +1345,11 @@
<pre class="programlisting"><span class="special">...</span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">accumulators</span><span class="special">/</span><span class="identifier">statistics</span><span class="special">/</span><span class="identifier">variance</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="special">...</span>
-<span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span>
- <span class="identifier">accumulator_set</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+<span class="keyword">typedef</span> <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a><span class="special">,</span>
+ <span class="identifier">accumulator_set</span><span class="special"><</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
<span class="identifier">features</span><span class="special"><</span>
<span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
<span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
@@ -1427,8 +1364,11 @@
are not taken in account by the default formatter? These statistics will
simply be ignored. So we will need to define our own accumulator formatter.
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span>
- <span class="identifier">accumulator_set</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
+<pre class="programlisting"><span class="keyword">typedef</span> <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><span class="special"><</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a><span class="special">,</span>
+ <span class="identifier">accumulator_set</span><span class="special"><</span><a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
<span class="identifier">features</span><span class="special"><</span>
<span class="identifier">tag</span><span class="special">::</span><span class="identifier">count</span><span class="special">,</span>
<span class="identifier">tag</span><span class="special">::</span><span class="identifier">sum</span><span class="special">,</span>
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 2010-07-05 18:54:00 EDT (Mon, 05 Jul 2010)
@@ -95,7 +95,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: July 04, 2010 at 21:52:08 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 05, 2010 at 22:51:38 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
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