|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74550 - trunk/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2011-09-24 12:09:20
Author: viboes
Date: 2011-09-24 12:09:19 EDT (Sat, 24 Sep 2011)
New Revision: 74550
URL: http://svn.boost.org/trac/boost/changeset/74550
Log:
Chrono: make process_cpu_clocks interact better with other clocks durations
Text files modified:
trunk/boost/chrono/process_cpu_clocks.hpp | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
Modified: trunk/boost/chrono/process_cpu_clocks.hpp
==============================================================================
--- trunk/boost/chrono/process_cpu_clocks.hpp (original)
+++ trunk/boost/chrono/process_cpu_clocks.hpp 2011-09-24 12:09:19 EDT (Sat, 24 Sep 2011)
@@ -101,10 +101,10 @@
rep user; // user cpu time
rep system; // system cpu time
- // operator rep()
- //{
- // return real;
- //}
+ operator rep()
+ {
+ return real;
+ }
template <typename Rep2>
bool operator==(process_times<Rep2> const& rhs) {
return (real==rhs.real &&
@@ -255,6 +255,16 @@
return rhs < lhs;
}
+ template <class Rep1, class Period1, class Rep2, class Period2>
+ inline BOOST_CHRONO_CONSTEXPR
+ bool
+ operator< (const duration<process_times<Rep1>, Period1>& lhs,
+ const duration<process_times<Rep2>, Period2>& rhs)
+ {
+ return boost::chrono::detail::duration_lt<
+ duration<Rep1, Period1>, duration<Rep2, Period2> >()(lhs, rhs);
+ }
+
typedef process_times<nanoseconds::rep> process_cpu_clock_times;
class BOOST_CHRONO_DECL process_cpu_clock
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