Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65946 - in sandbox/chrono/libs/chrono: example src test
From: vicente.botet_at_[hidden]
Date: 2010-10-13 18:39:58


Author: viboes
Date: 2010-10-13 18:39:56 EDT (Wed, 13 Oct 2010)
New Revision: 65946
URL: http://svn.boost.org/trac/boost/changeset/65946

Log:
Chrono:
* More on making configurable header-only library
* ex1.cpp updated to use chrono-io for all the clocks
Text files modified:
   sandbox/chrono/libs/chrono/example/io_ex1.cpp | 24 ++++++++----------------
   sandbox/chrono/libs/chrono/src/run_timer.cpp | 6 ++++++
   sandbox/chrono/libs/chrono/src/run_timer_static.cpp | 4 ++++
   sandbox/chrono/libs/chrono/test/Jamfile.v2 | 18 +++++++++---------
   4 files changed, 27 insertions(+), 25 deletions(-)

Modified: sandbox/chrono/libs/chrono/example/io_ex1.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/example/io_ex1.cpp (original)
+++ sandbox/chrono/libs/chrono/example/io_ex1.cpp 2010-10-13 18:39:56 EDT (Wed, 13 Oct 2010)
@@ -14,6 +14,7 @@
 
 #include <iostream>
 #include <boost/chrono/chrono_io.hpp>
+#include <boost/chrono/thread_clock.hpp>
 
 int main()
 {
@@ -49,21 +50,12 @@
 #endif
     cout << "\nSet cout to use long names:\n" << duration_long
          << "high_resolution_clock::now() = " << high_resolution_clock::now() << '\n';
+#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+ cout << "\nthread_clock::now() = " << thread_clock::now() << '\n';
+#endif
+ cout << "\nprocess_real_cpu_clock::now() = " << process_real_cpu_clock::now() << '\n';
+ cout << "\nprocess_user_cpu_clock::now() = " << process_user_cpu_clock::now() << '\n';
+ cout << "\nprocess_system_cpu_clock::now() = " << process_system_cpu_clock::now() << '\n';
+ cout << "\nprocess_cpu_clock::now() = " << process_cpu_clock::now() << '\n';
     return 0;
 }
-
-//~ milliseconds(3) + microseconds(10) = 3010 microseconds
-//~ hours(3) + minutes(10) = 190 minutes
-//~ ClockTick(3) + nanoseconds(10) = 56 [1/5000000000]seconds
-
-//~ Set cout to use short names:
-//~ milliseconds(3) + microseconds(10) = 3010 µs
-//~ hours(3) + minutes(10) = 190 m
-//~ ClockTick(3) + nanoseconds(10) = 56 [1/5000000000]s
-
-//~ system_clock::now() = 1284923218301231 µs since Jan 1, 1970
-//~ monotonic_clock::now() = 18588963676886 ns since boot
-
-//~ Set cout to use long names:
-//~ high_resolution_clock::now() = 18588963785548 nanoseconds since boot
-

Modified: sandbox/chrono/libs/chrono/src/run_timer.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/run_timer.cpp (original)
+++ sandbox/chrono/libs/chrono/src/run_timer.cpp 2010-10-13 18:39:56 EDT (Wed, 13 Oct 2010)
@@ -14,6 +14,10 @@
 // the library is being built (possibly exporting rather than importing code)
 #define BOOST_CHRONO_SOURCE
 
+#include <boost/chrono/detail/inlined/run_timer_static.hpp>
+
+#if 0
+
 #include <boost/version.hpp>
 #include <boost/chrono/process_times.hpp>
 #include <boost/system/system_error.hpp>
@@ -180,3 +184,5 @@
 
   } // namespace chrono
 } // namespace boost
+
+#endif
\ No newline at end of file

Modified: sandbox/chrono/libs/chrono/src/run_timer_static.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/run_timer_static.cpp (original)
+++ sandbox/chrono/libs/chrono/src/run_timer_static.cpp 2010-10-13 18:39:56 EDT (Wed, 13 Oct 2010)
@@ -20,6 +20,9 @@
 // define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows
 // the library is being built (possibly exporting rather than importing code)
 #define BOOST_CHRONO_SOURCE
+#include <boost/chrono/detail/inlined/run_timer_static.hpp>
+
+#if 0
 
 #include <boost/version.hpp>
 #include <boost/chrono/process_times.hpp>
@@ -34,3 +37,4 @@
 
   } // namespace chrono
 } // namespace boost
+#endif
\ No newline at end of file

Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2010-10-13 18:39:56 EDT (Wed, 13 Oct 2010)
@@ -86,15 +86,15 @@
         [ run ../example/timeval_demo.cpp : : : : timeval_demo_dll ]
         ;
 
- #test-suite "timer"
- # :
- # [ run ../example/run_timer_example.cpp : : : <link>static ]
- # [ run ../example/run_timer_example.cpp : : : : run_timer_example_dll ]
- # [ run ../example/run_timer_example2.cpp : : : <link>static ]
- # [ run ../example/run_timer_example2.cpp : : : : run_timer_example2_dll ]
- # [ run run_timer_test.cpp : : : <link>static ]
- # [ run run_timer_test.cpp : : : : run_timer_test_dll ]
- # ;
+ test-suite "timer"
+ :
+ [ run ../example/run_timer_example.cpp : : : <link>static ]
+ [ run ../example/run_timer_example.cpp : : : : run_timer_example_dll ]
+ [ run ../example/run_timer_example2.cpp : : : <link>static ]
+ [ run ../example/run_timer_example2.cpp : : : : run_timer_example2_dll ]
+ [ run run_timer_test.cpp : : : <link>static ]
+ [ run run_timer_test.cpp : : : : run_timer_test_dll ]
+ ;
 
     test-suite "other_clocks"
         :


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