Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59325 - in sandbox/chrono/libs/chrono: doc doc/html doc/html/boost_chrono doc/html/boost_chrono/appendices doc/html/boost_chrono/overview doc/html/boost_chrono/reference doc/html/boost_chrono/users_guide perf test
From: vicente.botet_at_[hidden]
Date: 2010-01-27 18:08:14


Author: viboes
Date: 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
New Revision: 59325
URL: http://svn.boost.org/trac/boost/changeset/59325

Log:
Boost.Chrono: Version 0.4.0,
* Add perf/stopclock_perf.cpp performances tests
* Add example of clock_name template metafunction
* Add generic test_clock
* make common_type_test more generic

Added:
   sandbox/chrono/libs/chrono/perf/
   sandbox/chrono/libs/chrono/perf/stopclock_perf.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock_name.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock_name.hpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/test_clock.cpp (contents, props changed)
Text files modified:
   sandbox/chrono/libs/chrono/doc/chrono.qbk | 31 +++++++++------
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html | 3 +
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html | 8 ++--
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html | 27 +++++++++++++
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html | 8 ++--
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html | 69 +++++++++++++++++++++++++++++++++++
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tickets.html | 23 +++++++++++
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html | 4 +-
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html | 20 +++++++++
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html | 75 +++++++++++++++++++++++++++++++++----
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html | 2
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html | 2
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html | 2
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html | 16 ++++----
   sandbox/chrono/libs/chrono/doc/html/index.html | 2
   sandbox/chrono/libs/chrono/test/Jamfile.v2 | 30 ++++++++------
   sandbox/chrono/libs/chrono/test/common_type_test.cpp | 78 ++++++++++++++++++++++++++-------------
   17 files changed, 317 insertions(+), 83 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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -62,13 +62,13 @@
     * `process_user_CPU_clocks`, capturing user-CPU times.
     * `process_system_CPU_clocks`, capturing system-CPU times.
     * `process_cpu_clock`, tuple-like class capturing at once real, user-CPU, and system-CPU times.
+
+* Thread clock
 
-[/
 * Suspendible Clock
     * Suspendible Clock concept
     * template class suspendible_clock<>
     * Added scope_suspend which do suspend/resume if the Clock is a model of Suspendible Clock concept, and nothing otherwise.
-]
 
 * Stopwatches:
     * `stopwatch`, capturing elapsed Clock times.
@@ -504,7 +504,7 @@
       // ...
     }
 
-[/
+
 [heading How reliable are these measure?]
 
 [info this section need to be reworked, the ideas are there, but ...]
@@ -523,7 +523,7 @@
 
 * 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 speending time reporting the measures, and resume it once the work is done.
 
-]
+
 
 
 [endsect]
@@ -4809,13 +4809,22 @@
 [section:history Appendix A: History]
 [/==================================]
 
+
+[section [*Version 0.4, Febrary 5, 2010] ['New thread clock and Suspendible clock ]]
+
+[*New Features:]
+
+* Suspendible Clock concept + template class suspendible_clock<>
+* Added scope_suspend which do suspend/resume if the Clock is a model of Suspendible Clock concept, and nothing otherwise.
+* thread_clock support on platforms providing it natively.
+
+[*Bug Fixes]
+
+[endsect]
+
 [section [*Version 0.3.2, January 25, 2010] ['New frequency, lifetime and percentage stopwatch_accumulator features]]
 [*Features:]
 
-[/* Suspendible Clock concept + template class suspendible_clock<>
-* Added scope_suspend which do suspend/resume if the Clock is a model of Suspendible Clock concept, and nothing otherwise.
-* Use of scope_suspend while reporting on stopwatch reporter
-]
 * Added overloading for operator/(Integer/Duration)
 * Added frequency, lifetime and percentage to the default stopwatch_accumulator_formatter
 
@@ -5139,7 +5148,7 @@
 ]
 [endsect]
 
-[/
+
 [section Other Clocks]
 [table
     [[Name] [kind] [Description] [Result] [Ticket]]
@@ -5147,8 +5156,6 @@
 ]
 [endsect]
 
-]
-
 [section stopwatch]
 [table
     [[Name] [kind] [Description] [Result] [Ticket]]
@@ -5220,7 +5227,7 @@
 
     [[20] [boost/chrono/scoped_suspend.hpp(31) : warning C4520: 'boost::chrono::scoped_suspend<Clock>' : multiple default constructors specified
 ] [XXXX] [Open]]
- [/[[19] [suspendible_clock_test doesn't works in my mingw environement (issue with tss)] [XXXX] [Open]]]
+ [[[19] [suspendible_clock_test doesn't works in my mingw environement (issue with tss)] [XXXX] [Open]]
     [[#] [XXXX] [XXXX] [Close]]
 ]
 

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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -29,6 +29,8 @@
 <div class="toc"><dl>
 <dt><span class="section"> Appendix A: History</span></dt>
 <dd><dl>
+<dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_4__febrary_5__2010____new_thread_clock_and_suspendible_clock__"><span class="bold"><strong>Version 0.4, Febrary 5, 2010</strong></span> <span class="emphasis"><em>New thread
+ clock and Suspendible clock </em></span></a></span></dt>
 <dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_3_2__january_25__2010____new_frequency__lifetime_and_percentage_stopwatch_accumulator_features_"><span class="bold"><strong>Version 0.3.2, January 25, 2010</strong></span> <span class="emphasis"><em>New frequency,
         lifetime and percentage stopwatch_accumulator features</em></span></a></span></dt>
 <dt><span class="section"><a href="appendices/history.html#boost_chrono.appendices.history.__version_0_3_1__january_20__2010____new_support_for_wide_characters_"><span class="bold"><strong>Version 0.3.1, January 20, 2010</strong></span> <span class="emphasis"><em>New support
@@ -52,6 +54,7 @@
 <dt><span class="section">common_type</span></dt>
 <dt><span class="section">ratio</span></dt>
 <dt><span class="section">chrono</span></dt>
+<dt><span class="section">Other Clocks</span></dt>
 <dt><span class="section">stopwatch</span></dt>
 </dl></dd>
 <dt><span class="section"> Appendix G: Tickets</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-01-27 18:08:12 EST (Wed, 27 Jan 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_common_type_lt__gt__template_arguments_"></a><h4>
-<a name="id4920153"></a>
+<a name="id4920214"></a>
         <a href="faq.html#boost_chrono.appendices.faq.how_important_is_the_order_of_the_common_type_lt__gt__template_arguments_">How
         important is the order of the common_type&lt;&gt; template arguments?</a>
       </h4>
@@ -60,7 +60,7 @@
         is also undefined.
       </p>
 <a name="boost_chrono.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_"></a><h4>
-<a name="id4920563"></a>
+<a name="id4920624"></a>
         <a href="faq.html#boost_chrono.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_">Why
         does stopwatch_reporter only display millisecond place precision when the
         underlying timer has nanosecond precision?</a>
@@ -71,7 +71,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="id4920604"></a>
+<a name="id4920665"></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>
@@ -81,7 +81,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="id4920638"></a>
+<a name="id4920699"></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>

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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -27,6 +27,8 @@
 <a name="boost_chrono.appendices.history"></a> Appendix A: History
 </h3></div></div></div>
 <div class="toc"><dl>
+<dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_4__febrary_5__2010____new_thread_clock_and_suspendible_clock__"><span class="bold"><strong>Version 0.4, Febrary 5, 2010</strong></span> <span class="emphasis"><em>New thread
+ clock and Suspendible clock </em></span></a></span></dt>
 <dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_3_2__january_25__2010____new_frequency__lifetime_and_percentage_stopwatch_accumulator_features_"><span class="bold"><strong>Version 0.3.2, January 25, 2010</strong></span> <span class="emphasis"><em>New frequency,
         lifetime and percentage stopwatch_accumulator features</em></span></a></span></dt>
 <dt><span class="section"><a href="history.html#boost_chrono.appendices.history.__version_0_3_1__january_20__2010____new_support_for_wide_characters_"><span class="bold"><strong>Version 0.3.1, January 20, 2010</strong></span> <span class="emphasis"><em>New support
@@ -41,6 +43,31 @@
 </dl></div>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.appendices.history.__version_0_4__febrary_5__2010____new_thread_clock_and_suspendible_clock__"></a><a href="history.html#boost_chrono.appendices.history.__version_0_4__febrary_5__2010____new_thread_clock_and_suspendible_clock__" title="Version 0.4, Febrary 5, 2010 New thread
+ clock and Suspendible clock "><span class="bold"><strong>Version 0.4, Febrary 5, 2010</strong></span> <span class="emphasis"><em>New thread
+ clock and Suspendible clock </em></span></a>
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>New Features:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Suspendible Clock concept + template class suspendible_clock&lt;&gt;
+ </li>
+<li>
+ Added scope_suspend which do suspend/resume if the Clock is a model of
+ Suspendible Clock concept, and nothing otherwise.
+ </li>
+<li>
+ thread_clock support on platforms providing it natively.
+ </li>
+</ul></div>
+<p>
+ <span class="bold"><strong>Bug Fixes</strong></span>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
 <a name="boost_chrono.appendices.history.__version_0_3_2__january_25__2010____new_frequency__lifetime_and_percentage_stopwatch_accumulator_features_"></a><a href="history.html#boost_chrono.appendices.history.__version_0_3_2__january_25__2010____new_frequency__lifetime_and_percentage_stopwatch_accumulator_features_" title="Version 0.3.2, January 25, 2010 New frequency,
         lifetime and percentage stopwatch_accumulator features"><span class="bold"><strong>Version 0.3.2, January 25, 2010</strong></span> <span class="emphasis"><em>New frequency,
         lifetime and percentage stopwatch_accumulator features</em></span></a>

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-01-27 18:08:12 EST (Wed, 27 Jan 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__code__phrase_role__identifier__duration__phrase___code__to_a_function_with_the_units_being_ambiguous_"></a><h4>
-<a name="id4918937"></a>
+<a name="id4918998"></a>
         <a href="rationale.html#boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a__code__phrase_role__identifier__duration__phrase___code__to_a_function_with_the_units_being_ambiguous_">Is
         it possible for the user to pass a <code class="computeroutput"><span class="identifier">duration</span></code>
         to a function with the units being ambiguous?</a>
@@ -45,7 +45,7 @@
 <pre class="programlisting"><span class="identifier">f</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// Will not compile, 3 is not implicitly convertible to any `duration`
 </span></pre>
 <a name="boost_chrono.appendices.rationale.why_duration_needs_operator_"></a><h4>
-<a name="id4919026"></a>
+<a name="id4919088"></a>
         <a href="rationale.html#boost_chrono.appendices.rationale.why_duration_needs_operator_">Why
         duration needs operator%</a>
       </h4>
@@ -73,7 +73,7 @@
 <span class="special">};</span>
 </pre>
 <a name="boost_chrono.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form"></a><h4>
-<a name="id4919607"></a>
+<a name="id4919668"></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>
@@ -101,7 +101,7 @@
         ratio&lt;1,3&gt; and the compilation succeeds.
       </p>
 <a name="boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
-<a name="id4919920"></a>
+<a name="id4919981"></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/tests.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -31,6 +31,7 @@
 <dt><span class="section">common_type</span></dt>
 <dt><span class="section">ratio</span></dt>
 <dt><span class="section">chrono</span></dt>
+<dt><span class="section">Other Clocks</span></dt>
 <dt><span class="section">stopwatch</span></dt>
 </dl></div>
 <p>
@@ -686,6 +687,74 @@
 </div>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.appendices.tests.other_clocks"></a>Other Clocks
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ test_suspendible_clock
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ test basic uses of suspendible_clock.
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
 <a name="boost_chrono.appendices.tests.stopwatch"></a>stopwatch
 </h4></div></div></div>
 <div class="informaltable"><table class="table">

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tickets.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tickets.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tickets.html 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -559,6 +559,29 @@
 <tr>
 <td>
               <p>
+ [19
+ </p>
+ </td>
+<td>
+ <p>
+ suspendible_clock_test doesn't works in my mingw environement (issue
+ with tss)
+ </p>
+ </td>
+<td>
+ <p>
+ XXXX
+ </p>
+ </td>
+<td>
+ <p>
+ Open
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
                 #
               </p>
               </td>

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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -26,7 +26,7 @@
 <a name="boost_chrono.appendices.todo"></a> Appendix H: Future plans
 </h3></div></div></div>
 <a name="boost_chrono.appendices.todo.tasks_to_do_before_review"></a><h4>
-<a name="id4923094"></a>
+<a name="id4923292"></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="id4923133"></a>
+<a name="id4923331"></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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -98,6 +98,24 @@
 </ul></div>
 </li>
 <li>
+ Thread clock
+ </li>
+<li>
+ Suspendible Clock
+ <div class="itemizedlist"><ul type="circle">
+<li>
+ Suspendible Clock concept
+ </li>
+<li>
+ template class suspendible_clock&lt;&gt;
+ </li>
+<li>
+ Added scope_suspend which do suspend/resume if the Clock is a model of
+ Suspendible Clock concept, and nothing otherwise.
+ </li>
+</ul></div>
+</li>
+<li>
         Stopwatches:
         <div class="itemizedlist"><ul type="circle">
 <li>
@@ -132,7 +150,7 @@
 </li>
 </ul></div>
 <a name="boost_chrono.overview.how_to_use_this_documentation"></a><h3>
-<a name="id4765074"></a>
+<a name="id4765100"></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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -237,7 +237,7 @@
           needs only 23 bits to cover that range.
         </p>
 <a name="boost_chrono.overview.motivation.duration.so_what_exactly_is_a__code__phrase_role__identifier__duration__phrase___code__and_how_do_i_use_one_"></a><h5>
-<a name="id4759415"></a>
+<a name="id4759434"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.so_what_exactly_is_a__code__phrase_role__identifier__duration__phrase___code__and_how_do_i_use_one_">So
           What Exactly is a <code class="computeroutput"><span class="identifier">duration</span></code>
           and How Do I Use One?</a>
@@ -295,7 +295,7 @@
           instead of inheritance).
         </p>
 <a name="boost_chrono.overview.motivation.duration.what_happens_if_i_assign__code__phrase_role__identifier__m3__phrase___phrase_role__special_____phrase___phrase_role__identifier__us3__phrase___code__to__code__phrase_role__identifier__minutes__phrase___code__instead_of__code__phrase_role__identifier__microseconds__phrase___code__"></a><h5>
-<a name="id4813031"></a>
+<a name="id4813049"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.what_happens_if_i_assign__code__phrase_role__identifier__m3__phrase___phrase_role__special_____phrase___phrase_role__identifier__us3__phrase___code__to__code__phrase_role__identifier__minutes__phrase___code__instead_of__code__phrase_role__identifier__microseconds__phrase___code__">What
           happens if I assign <code class="computeroutput"><span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span></code>
           to <code class="computeroutput"><span class="identifier">minutes</span></code> instead of
@@ -312,7 +312,7 @@
           ignored. This is similar to the problem of assigning a double to an <code class="computeroutput"><span class="keyword">int</span></code>: the fractional part gets silently discarded.
         </p>
 <a name="boost_chrono.overview.motivation.duration.but_what_if_the_truncation_behavior_is_what_i_want_to_do_"></a><h5>
-<a name="id4813200"></a>
+<a name="id4813217"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.but_what_if_the_truncation_behavior_is_what_i_want_to_do_">But
           what if the truncation behavior is what I want to do?</a>
         </h5>
@@ -332,7 +332,7 @@
           as often as it can.
         </p>
 <a name="boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point__code__phrase_role__identifier__duration__phrase___code_s__i_don_t_want_to_deal_with_writing__code__phrase_role__identifier__duration_cast__phrase___code__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation"></a><h5>
-<a name="id4813336"></a>
+<a name="id4813353"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point__code__phrase_role__identifier__duration__phrase___code_s__i_don_t_want_to_deal_with_writing__code__phrase_role__identifier__duration_cast__phrase___code__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation">I'm
           trafficking in floating point <code class="computeroutput"><span class="identifier">duration</span></code>s.
           I don't want to deal with writing <code class="computeroutput"><span class="identifier">duration_cast</span></code>
@@ -347,7 +347,7 @@
 <span class="identifier">dminutes</span> <span class="identifier">dm4</span> <span class="special">=</span> <span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span><span class="special">;</span> <span class="comment">// dm4.count() == 5.000000083333333
 </span></pre>
 <a name="boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_"></a><h5>
-<a name="id4813499"></a>
+<a name="id4813516"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_">How
           expensive is all of this?</a>
         </h5>
@@ -361,7 +361,7 @@
           tick counts.
         </p>
 <a name="boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a__code__phrase_role__identifier__duration__phrase___code__parameter_"></a><h5>
-<a name="id4813549"></a>
+<a name="id4813566"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a__code__phrase_role__identifier__duration__phrase___code__parameter_">How
           complicated is it to build a function taking a <code class="computeroutput"><span class="identifier">duration</span></code>
           parameter?</a>
@@ -583,7 +583,7 @@
           the relationship between the epochs associated with each clock is known.
         </p>
 <a name="boost_chrono.overview.motivation.time_point.so_what_exactly_is_a__code__phrase_role__identifier__time_point__phrase___code__and_how_do_i_use_one_"></a><h5>
-<a name="id4815354"></a>
+<a name="id4815371"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.time_point.so_what_exactly_is_a__code__phrase_role__identifier__time_point__phrase___code__and_how_do_i_use_one_">So
           What Exactly is a <code class="computeroutput"><span class="identifier">time_point</span></code>
           and How Do I Use One?</a>
@@ -706,7 +706,7 @@
 <span class="number">0.017</span><span class="identifier">s</span>
 </pre>
 <a name="boost_chrono.overview.motivation.stopwatches.stopwatches_accumulation_and_statistics"></a><h5>
-<a name="id4816458"></a>
+<a name="id4816475"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.stopwatches.stopwatches_accumulation_and_statistics">Stopwatches
           accumulation and statistics</a>
         </h5>
@@ -743,7 +743,7 @@
 <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>
 <a name="boost_chrono.overview.motivation.stopwatches.wall_clock_versus_system_and_user_time"></a><h5>
-<a name="id4816976"></a>
+<a name="id4816992"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.stopwatches.wall_clock_versus_system_and_user_time">Wall
           clock versus system and user time</a>
         </h5>
@@ -798,6 +798,63 @@
   <span class="comment">// ...
 </span><span class="special">}</span>
 </pre>
+<a name="boost_chrono.overview.motivation.stopwatches.how_reliable_are_these_measure_"></a><h5>
+<a name="id4817380"></a>
+ <a href="motivation.html#boost_chrono.overview.motivation.stopwatches.how_reliable_are_these_measure_">How
+ reliable are these measure?</a>
+ </h5>
+<p>
+ [info this section need to be reworked, the ideas are there, but ...]
+ </p>
+<p>
+ There are three context on which you can get unreliable measures:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ the 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.
+ </li>
+<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. The library provide
+ a thread_clock on platforms providing this kind of data.
+ </li>
+<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 many time
+ is related to the application code we want to measure and how many to
+ the fact we are meassuring and logging in inner blocks?
+ </li>
+</ol></div>
+<p>
+ Some measures let me 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 the expensive operations as reporting 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 speending time reporting the measures, and resume
+ it once the work is done.
+ </li>
+</ul></div>
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/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-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -608,7 +608,7 @@
             and both of these calls happen before <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">::</span><span class="identifier">max</span><span class="special">()</span></code>.
           </p>
 <div class="table">
-<a name="id4839287"></a><p class="title"><b>Table 1. Clock Requirements</b></p>
+<a name="id4839281"></a><p class="title"><b>Table 1. Clock Requirements</b></p>
 <table class="table" summary="Clock Requirements">
 <colgroup>
 <col>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatch_reporters.html 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -78,7 +78,7 @@
           <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span></code>, ec is a system::error_code
         </p>
 <div class="table">
-<a name="id4871278"></a><p class="title"><b>Table 3. Stopwatch Requirements</b></p>
+<a name="id4871272"></a><p class="title"><b>Table 3. Stopwatch Requirements</b></p>
 <table class="table" summary="Stopwatch Requirements">
 <colgroup>
 <col>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -135,7 +135,7 @@
           is an instance of <code class="computeroutput"><span class="identifier">S</span></code>.
         </p>
 <div class="table">
-<a name="id4863025"></a><p class="title"><b>Table 2. Stopwatch Requirements</b></p>
+<a name="id4863019"></a><p class="title"><b>Table 2. Stopwatch Requirements</b></p>
 <table class="table" summary="Stopwatch Requirements">
 <colgroup>
 <col>

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-01-27 18:08:12 EST (Wed, 27 Jan 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="id4817433"></a>
+<a name="id4817559"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono__emphasis__">Getting
           <span class="bold"><strong>Boost.Chrono</strong></span> </a>
         </h5>
@@ -53,7 +53,7 @@
           Sandbox</a>.
         </p>
 <a name="boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___"></a><h5>
-<a name="id4817494"></a>
+<a name="id4817620"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___">Where
           to install <span class="bold"><strong>Boost.Chrono</strong></span>? </a>
         </h5>
@@ -69,7 +69,7 @@
           variable. Any help is welcome.
         </p>
 <a name="boost_chrono.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4758235"></a>
+<a name="id4817662"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono__emphasis__">Building
           <span class="bold"><strong>Boost.Chrono</strong></span> </a>
         </h5>
@@ -80,7 +80,7 @@
 <pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">libs</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">build</span>
 </pre>
 <a name="boost_chrono.users_guide.getting_started.install.requirements"></a><h5>
-<a name="id4758306"></a>
+<a name="id4817730"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.requirements">Requirements</a>
         </h5>
 <p>
@@ -129,7 +129,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="id4817947"></a>
+<a name="id4817931"></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>
@@ -139,7 +139,7 @@
           with the Boost System library.
         </p>
 <a name="boost_chrono.users_guide.getting_started.install.exceptions_safety_"></a><h5>
-<a name="id4817983"></a>
+<a name="id4817967"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.exceptions_safety_">Exceptions
           safety </a>
         </h5>
@@ -148,7 +148,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="id4818010"></a>
+<a name="id4817993"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.thread_safety_">Thread
           safety </a>
         </h5>
@@ -156,7 +156,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="id4818034"></a>
+<a name="id4818018"></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/index.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/index.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/index.html 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -120,7 +120,7 @@
 </table></div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: January 26, 2010 at 17:22:27 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 26, 2010 at 20:17:56 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Added: sandbox/chrono/libs/chrono/perf/stopclock_perf.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/perf/stopclock_perf.cpp 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -0,0 +1,159 @@
+// stopclock_perf.cpp ---------------------------------------------------//
+
+// Copyright 2009 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// See http://www.boost.org/libs/chrono for documentation.
+
+#include <boost/thread.hpp>
+#include <boost/chrono/stopclock.hpp>
+#include <boost/chrono/thread_clock.hpp>
+
+#include <boost/chrono/suspendible_clock.hpp>
+#include <boost/chrono/stopclock_accumulator.hpp>
+#include <cmath>
+
+using namespace boost::chrono;
+double res;
+
+template <typename Clock>
+void f1(long j)
+{
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j!=0) {
+ f1<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+}
+
+template <typename Clock>
+void f2(long j)
+{
+ stopclock<Clock> b(9);
+
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j!=0) {
+ //std::cout << "f1("<<j-1<<")\n";
+ f2<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+}
+
+template <typename Clock>
+void f3(long j)
+{
+ stopclock<suspendible_clock<Clock> > a(9);
+
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j!=0) {
+ //std::cout << "f1("<<j-1<<")\n";
+ f3<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+}
+
+template <typename Clock>
+void f4(long j)
+{
+ static stopclock_accumulator<Clock> acc(9);
+ typename stopclock_accumulator<Clock>::scoped_run c(acc);
+
+ for ( long i = 0; i < j; ++i )
+ res+=std::sqrt( res+123.456L+i ); // burn some time
+ if (j!=0) {
+ //std::cout << "f1("<<j-1<<")\n";
+ f4<Clock>(j-1);
+ }
+ //boost::this_thread::sleep(boost::posix_time::milliseconds(10));
+}
+
+template <typename Clock, long SIZE>
+void test_clock_size()
+{
+ std::cout << ">>> test_clock_size() " << SIZE << std::endl;
+ //stopclock<> _(BOOST_CHRONO_TIME_FUNCTION_FORMAT);
+ //stopclock<> _(9);
+ //stopclock<suspendible_clock<high_resolution_clock> > a(9);
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> NONE ")+ stopwatch_formatter::default_format());
+
+ for (long i =1; i<= 3; ++i)
+ f1<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> HIGH ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= 3; ++i)
+ f2<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<suspendible_clock<high_resolution_clock> > a(9, std::string(">>> SUSPEND ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= 3; ++i)
+ f3<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> ACCU ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= 3; ++i)
+ f4<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> NONE ")+ stopwatch_formatter::default_format());
+
+ for (long i =1; i<= 3; ++i)
+ f1<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+ {
+ res=0;
+ stopclock<Clock> b(9, std::string(">>> ACCU ") + stopwatch_formatter::default_format());
+
+ for (long i =1; i<= 3; ++i)
+ f4<Clock>(i*SIZE);
+ std::cout<< res << std::endl;
+ }
+}
+
+template <typename Clock>
+void test_clock()
+{
+ std::cout << ">>> test_clock() " << std::endl;
+ test_clock_size<Clock, 100>();
+ test_clock_size<Clock, 200>();
+ test_clock_size<Clock, 400>();
+ test_clock_size<Clock, 800>();
+ test_clock_size<Clock, 1600>();
+ test_clock_size<Clock, 3200>();
+}
+
+
+int main() {
+#ifdef BOOST_CHRONO_HAS_THREAD_CLOCK
+ std::cout << ">>> main()-thread_clock" << std::endl;
+ test_clock<thread_clock>();
+#endif
+ std::cout << ">>> main()-high_resolution_clock" << std::endl;
+ test_clock<high_resolution_clock>();
+#ifdef BOOST_CHRONO_HAS_THREAD_CLOCK
+ std::cout << ">>> main()-thread_clock" << std::endl;
+ test_clock<thread_clock>();
+#endif
+
+ return 0;
+
+}

Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -51,8 +51,8 @@
         [ run explore_limits.cpp : : : : explore_limits_dll ]
         [ run test_duration.cpp : : : <link>static ]
         [ run test_duration.cpp : : : : test_duration_dll ]
- [ run test_system_clock.cpp : : : <link>static ]
- [ run test_system_clock.cpp : : : : test_system_clock_dll ]
+ [ run test_clock.cpp : : : <link>static ]
+ [ run test_clock.cpp : : : : test_clock_dll ]
         [ run miscellaneous.cpp : : : <link>static ]
         [ run miscellaneous.cpp : : : : miscellaneous_dll ]
         [ run test_special_values.cpp : : : <link>static ]
@@ -90,16 +90,16 @@
         [ run run_timer_test.cpp : : : : run_timer_test_dll ]
         ;
 
- #test-suite "other_clocks"
- # :
- # [ run test_suspendible_clock.cpp : : : <library>/boost/thread//boost_thread <link>static ]
- # [ run test_suspendible_clock.cpp : : : <library>/boost/thread//boost_thread : test_suspendible_clock_dll ]
- # [ run ../example/suspendible_stopclock_example.cpp : : : <library>/boost/thread//boost_thread <link>static ]
- # [ run ../example/suspendible_stopclock_example.cpp : : : <library>/boost/thread//boost_thread : suspendible_stopclock_example_dll ]
- # [ run test_thread_clock.cpp : : : <link>static ]
- # [ run test_thread_clock.cpp : : : : test_thread_clock_dll ]
- # ;
-
+ test-suite "other_clocks"
+ :
+ #[ run test_suspendible_clock.cpp : : : <library>/boost/thread//boost_thread <link>static ]
+ #[ run test_suspendible_clock.cpp : : : <library>/boost/thread//boost_thread : test_suspendible_clock_dll ]
+ #[ run ../example/suspendible_stopclock_example.cpp : : : <library>/boost/thread//boost_thread <link>static ]
+ #[ run ../example/suspendible_stopclock_example.cpp : : : <library>/boost/thread//boost_thread : suspendible_stopclock_example_dll ]
+ [ run test_thread_clock.cpp : : : <link>static ]
+ [ run test_thread_clock.cpp : : : : test_thread_clock_dll ]
+ ;
+
     test-suite "stopwatch"
         :
         [ run ../example/stopwatch_example.cpp : : : <link>static ]
@@ -131,4 +131,8 @@
         [ run wstopclock_constructor_overload_test.cpp : : : : wstopclock_constructor_overload_test_dll ]
         ;
         
-
+ test-suite "perf"
+ :
+ [ run ../perf/stopclock_perf.cpp : : : <library>/boost/thread//boost_thread <link>static ]
+ [ run ../perf/stopclock_perf.cpp : : : <library>/boost/thread//boost_thread : stopclock_perf_dll ]
+ ;

Added: sandbox/chrono/libs/chrono/test/clock_name.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock_name.cpp 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -0,0 +1,20 @@
+// stopclock_perf.cpp ---------------------------------------------------//
+
+// Copyright 2009 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// See http://www.boost.org/libs/chrono for documentation.
+
+#include "clock_name.hpp"
+#include <iostream>
+
+int main()
+{
+ std::cout << name<boost::chrono::system_clock>::apply() << '\n';
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ std::cout << name<boost::chrono::monotonic_clock>::apply() << '\n';
+#endif
+ std::cout << name<boost::chrono::high_resolution_clock>::apply() << '\n';
+}

Added: sandbox/chrono/libs/chrono/test/clock_name.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock_name.hpp 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -0,0 +1,67 @@
+// stopclock_perf.cpp ---------------------------------------------------//
+
+// Copyright 2009 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// See http://www.boost.org/libs/chrono for documentation.
+
+#ifndef BOOST_CHRONO_CLOCK_NAME__HPP
+#define BOOST_CHRONO_CLOCK_NAME__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+template <typename Clock,
+ bool = boost::is_same<Clock, boost::chrono::system_clock>::value,
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ bool = boost::is_same<Clock, boost::chrono::monotonic_clock>::value,
+#else
+ bool = false,
+#endif
+ bool = boost::is_same<Clock, boost::chrono::high_resolution_clock>::value
+ >
+struct name;
+
+template <typename Clock>
+struct name<Clock, false, false, false> {
+ static const char* apply() { return "unknown clock";}
+};
+
+template <typename Clock>
+struct name<Clock, true, false, false> {
+ static const char* apply() { return "system_clock";}
+};
+
+template <typename Clock>
+struct name<Clock, false, true, false> {
+ static const char* apply() { return "monotonic_clock";}
+};
+
+template <typename Clock>
+struct name<Clock, false, false, true> {
+ static const char* apply() { return "high_resolution_clock";}
+};
+
+template <typename Clock>
+struct name<Clock, false, true, true> {
+ static const char* apply() { return "monotonic_clock and high_resolution_clock";}
+};
+
+template <typename Clock>
+struct name<Clock, true, false, true> {
+ static const char* apply() { return "system_clock and high_resolution_clock";}
+};
+
+template <typename Clock>
+struct name<Clock, true, true, false> {
+ static const char* apply() { return "system_clock and monotonic_clock";}
+};
+
+template <typename Clock>
+struct name<Clock, true, true, true> {
+ static const char* apply() { return "system_clock, monotonic_clock and high_resolution_clock";}
+};
+
+#endif
\ No newline at end of file

Modified: sandbox/chrono/libs/chrono/test/common_type_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/common_type_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/common_type_test.cpp 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -10,47 +10,73 @@
 #include <boost/type_traits/common_type.hpp>
 #include <iostream>
 
-struct A {};
+#include <boost/test/minimal.hpp>
+
+struct C1 {};
     
-struct B {};
+struct C2 {};
 
-struct C {
- C() {}
- C(A const&) {}
- C(B const&) {}
- C& operator=(C const&) {
+struct C1C2 {
+ C1C2() {}
+ C1C2(C1 const&) {}
+ C1C2(C2 const&) {}
+ C1C2& operator=(C1C2 const&) {
         return *this;
     }
 };
 
-typedef boost::common_type<A, C>::type AC;
-typedef boost::common_type<B, C>::type BC;
+template <typename C, typename A>
+void f2(typename boost::common_type<A, C>::type const& rhs) {}
 
-#if 0
-typedef boost::common_type<A, B, C>::type ABC; // DO not compile
-#else
-typedef boost::common_type<C, B, A>::type ABC;
-#endif
-void f(ABC const& rhs) {}
-
-int main()
-{
+template <typename C, typename A, typename B>
+void f3(typename boost::common_type<C, A, B>::type const& rhs) {}
+
+template <typename C, typename A>
+void assignation_2() {
+typedef typename boost::common_type<A, C>::type AC;
     A a;
- B b;
     C c;
     AC ac;
     ac=a;
     ac=c;
+
+ f2<C, A>(a);
+ f2<C, A>(c);
     
+}
+
+template <typename C, typename A, typename B>
+void assignation_3() {
+#if 0
+typedef typename boost::common_type<A, B, C>::type ABC; // DO not compile
+#else
+typedef typename boost::common_type<C, A, B>::type ABC;
+#endif
+ A a;
+ B b;
+ C c;
     ABC abc;
- c=b;
- c=a;
+
     abc=a;
     abc=b;
     abc=c;
- f(abc);
- f(a);
- f(b);
- f(c);
- return 0;
+
+ f3<C, A, B>(a);
+ f3<C, A, B>(b);
+ f3<C, A, B>(c);
+}
+
+int test_main( int argc, char * argv[] )
+{
+ //~ assignation_2<C1, C2>(); // fails
+ assignation_2<C1C2, C1>();
+ assignation_2<C1, C1C2>();
+ assignation_2<C1C2, C2>();
+ assignation_2<C2, C1C2>();
+ assignation_3<C1, C1C2, C2>();
+ assignation_3<C1C2, C1, C2>();
+ assignation_3<C2, C1C2, C1>();
+ assignation_3<C1C2, C2, C1>();
+ //~ assignation_3<C1, C2, C1C2>(); // fails
+ return 0;
 }

Added: sandbox/chrono/libs/chrono/test/test_clock.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/test_clock.cpp 2010-01-27 18:08:12 EST (Wed, 27 Jan 2010)
@@ -0,0 +1,172 @@
+// test_system_clock.cpp ----------------------------------------------------------//
+
+// Copyright 2008 Howard Hinnant
+// Copyright 2008 Beman Dawes
+// Copyright 2009 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+/*
+This code was extracted by Vicente J. Botet Escriba from Beman Dawes time2_demo.cpp which
+was derived by Beman Dawes from Howard Hinnant's time2_demo prototype.
+Many thanks to Howard for making his code available under the Boost license.
+The original code was modified to conform to Boost conventions and to section
+20.9 Time utilities [time] of the C++ committee's working paper N2798.
+See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2798.pdf.
+
+time2_demo contained this comment:
+
+ Much thanks to Andrei Alexandrescu,
+ Walter Brown,
+ Peter Dimov,
+ Jeff Garland,
+ Terry Golubiewski,
+ Daniel Krügler,
+ Anthony Williams.
+*/
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/type_traits.hpp>
+
+#include <iostream>
+
+#include "clock_name.hpp"
+
+using namespace boost::chrono;
+
+template <typename Clock>
+void test_clock()
+{
+ std::cout << "\n"<< name<Clock>::apply() << " test" << std::endl;
+{
+ typename Clock::duration delay = milliseconds(5);
+ typename Clock::time_point start = Clock::now();
+ while (Clock::now() - start <= delay)
+ ;
+ typename Clock::time_point stop = Clock::now();
+ //typename Clock::duration elapsed = stop - start;
+ std::cout << "5 milliseconds paused " << nanoseconds(stop - start).count() << " nanoseconds\n";
+}
+{
+ typename Clock::time_point start = Clock::now();
+ typename Clock::time_point stop;
+ std::size_t count=1;
+ while ((stop=Clock::now()) == start) {
+ ++count;
+ }
+ //typename Clock::duration elapsed = stop - start;
+ std::cout << "After " << count << " trials, elapsed time " << nanoseconds(stop - start).count() << " nanoseconds\n";
+
+ start = Clock::now();
+ for (std::size_t c=count; c>0; --c) {
+ stop=Clock::now();;
+ }
+ std::cout << "After " << count << " trials, elapsed time " << nanoseconds(stop - start).count() << " nanoseconds\n";
+
+
+}
+{
+ typename Clock::time_point start = Clock::now();
+ typename Clock::time_point stop = Clock::now();
+ std::cout << "Resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+}
+}
+
+void test_system_clock()
+{
+ std::cout << "system_clock test" << std::endl;
+ system_clock::duration delay = milliseconds(5);
+ system_clock::time_point start = system_clock::now();
+ while (system_clock::now() - start <= delay)
+ ;
+ system_clock::time_point stop = system_clock::now();
+ system_clock::duration elapsed = stop - start;
+ std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
+ start = system_clock::now();
+ stop = system_clock::now();
+ std::cout << "system_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+}
+
+void test_monotonic_clock()
+{
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ std::cout << "monotonic_clock test" << std::endl;
+ monotonic_clock::duration delay = milliseconds(5);
+ monotonic_clock::time_point start = monotonic_clock::now();
+ while (monotonic_clock::now() - start <= delay)
+ ;
+ monotonic_clock::time_point stop = monotonic_clock::now();
+ monotonic_clock::duration elapsed = stop - start;
+ std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
+ start = monotonic_clock::now();
+ stop = monotonic_clock::now();
+ std::cout << "monotonic_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+#endif
+}
+void test_hi_resolution_clock()
+{
+ std::cout << "high_resolution_clock test" << std::endl;
+ high_resolution_clock::duration delay = milliseconds(5);
+ high_resolution_clock::time_point start = high_resolution_clock::now();
+ while (high_resolution_clock::now() - start <= delay)
+ ;
+ high_resolution_clock::time_point stop = high_resolution_clock::now();
+ high_resolution_clock::duration elapsed = stop - start;
+ std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
+ start = high_resolution_clock::now();
+ stop = high_resolution_clock::now();
+ std::cout << "high_resolution_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+}
+
+//void test_mixed_clock()
+//{
+// std::cout << "mixed clock test" << std::endl;
+// high_resolution_clock::time_point hstart = high_resolution_clock::now();
+// std::cout << "Add 5 milliseconds to a high_resolution_clock::time_point\n";
+// monotonic_clock::time_point mend = hstart + milliseconds(5);
+// bool b = hstart == mend;
+// system_clock::time_point sstart = system_clock::now();
+// std::cout << "Subtracting system_clock::time_point from monotonic_clock::time_point doesn't compile\n";
+//// mend - sstart; // doesn't compile
+// std::cout << "subtract high_resolution_clock::time_point from monotonic_clock::time_point"
+// " and add that to a system_clock::time_point\n";
+// system_clock::time_point send = sstart + duration_cast<system_clock::duration>(mend - hstart);
+// std::cout << "subtract two system_clock::time_point's and output that in microseconds:\n";
+// microseconds ms = send - sstart;
+// std::cout << ms.count() << " microseconds\n";
+//}
+//
+//void test_c_mapping()
+//{
+// std::cout << "C map test\n";
+// using namespace boost::chrono;
+// system_clock::time_point t1 = system_clock::now();
+// std::time_t c_time = system_clock::to_time_t(t1);
+// std::tm* tmptr = std::localtime(&c_time);
+// std::cout << "It is now " << tmptr->tm_hour << ':' << tmptr->tm_min << ':' << tmptr->tm_sec << ' '
+// << tmptr->tm_year + 1900 << '-' << tmptr->tm_mon + 1 << '-' << tmptr->tm_mday << '\n';
+// c_time = std::mktime(tmptr);
+// system_clock::time_point t2 = system_clock::from_time_t(c_time);
+// microseconds ms = t1 - t2;
+// std::cout << "Round-tripping through the C interface truncated the precision by " << ms.count() << " microseconds\n";
+//}
+
+
+int main()
+{
+ test_system_clock();
+ test_monotonic_clock();
+ test_hi_resolution_clock();
+ //test_mixed_clock();
+ test_clock<system_clock>();
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ test_clock<monotonic_clock>();
+#endif
+ test_clock<high_resolution_clock>();
+
+
+
+ return 0;
+}
+


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