$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r64874 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-08-17 19:51:15
Author: viboes
Date: 2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
New Revision: 64874
URL: http://svn.boost.org/trac/boost/changeset/64874
Log:
* Reorganize default formatter
* Add stopwatch_accumulator_time_formatter.hpp
Added:
   sandbox/chrono/boost/chrono/stopwatch_accumulator_time_formatter.hpp   (contents, props changed)
Text files modified: 
   sandbox/chrono/boost/chrono/scoped_stopclock.hpp      |     1 +                                       
   sandbox/chrono/boost/chrono/stopclock.hpp             |    34 +++++++++++++++++++++++++++++++++-      
   sandbox/chrono/boost/chrono/stopclock_accumulator.hpp |    36 ++++++++++++++++++++++++++++++++++--    
   sandbox/chrono/boost/chrono/stopwatch.hpp             |    17 -----------------                       
   sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp |    18 +-----------------                      
   sandbox/chrono/boost/chrono/stopwatches.hpp           |     3 ++-                                     
   sandbox/chrono/boost/chrono/time_formatter.hpp        |    29 +++++++++++++++--------------           
   7 files changed, 86 insertions(+), 52 deletions(-)
Modified: sandbox/chrono/boost/chrono/scoped_stopclock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/scoped_stopclock.hpp	(original)
+++ sandbox/chrono/boost/chrono/scoped_stopclock.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -14,6 +14,7 @@
 #include <boost/chrono/stopwatch.hpp>
 #include <boost/chrono/process_cpu_clocks.hpp>
 #include <boost/chrono/time_formatter.hpp>
+#include <boost/chrono/stopwatch_accumulator_time_formatter.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last #include
 
Modified: sandbox/chrono/boost/chrono/stopclock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock.hpp	(original)
+++ sandbox/chrono/boost/chrono/stopclock.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -13,10 +13,11 @@
 #include <boost/chrono/config.hpp>
 #include <boost/chrono/detail/static_assert.hpp>
 #include <boost/chrono/stopwatch_reporter.hpp>
+#include <boost/chrono/stopwatch_formatter.hpp>
+#include <boost/chrono/time_formatter.hpp>
 #include <boost/chrono/stopwatch.hpp>
 //#include <boost/chrono/chrono.hpp>
 #include <boost/chrono/process_cpu_clocks.hpp>
-#include <boost/chrono/time_formatter.hpp>
 #include <boost/type_traits/is_same.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last #include
@@ -43,6 +44,37 @@
  */
 //--------------------------------------------------------------------------------------//
 
+    template <class Clock>
+    struct stopwatch_reporter_default_formatter<stopwatch<Clock> > {
+        typedef stopwatch_formatter type;
+    };
+
+    template <class Clock>
+    struct wstopwatch_reporter_default_formatter<stopwatch<Clock> > {
+        typedef wstopwatch_formatter type;
+    };
+
+    template <>
+    struct stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> > {
+        typedef time_formatter type;
+    };
+
+    template <>
+    struct wstopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> > {
+        typedef wtime_formatter type;
+    };
+
+    template <>
+    struct stopwatch_reporter_default_formatter<stopwatch<suspendible_clock<process_cpu_clock> > > {
+        typedef stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> >::type  type;
+    };
+
+    template <>
+    struct wstopwatch_reporter_default_formatter<stopwatch<suspendible_clock<process_cpu_clock> > > {
+        typedef wstopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> >::type  type;
+    };
+
+
     template <class Clock, class Formatter>
     class basic_stopclock : public basic_stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> {
         typedef basic_stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> base_type;
Modified: sandbox/chrono/boost/chrono/stopclock_accumulator.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock_accumulator.hpp	(original)
+++ sandbox/chrono/boost/chrono/stopclock_accumulator.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -16,6 +16,7 @@
 #include <boost/chrono/stopwatch_reporter.hpp>
 #include <boost/chrono/stopwatch_accumulator.hpp>
 #include <boost/chrono/stopwatch_accumulator_formatter.hpp>
+#include <boost/chrono/stopwatch_accumulator_time_formatter.hpp>
 #include <boost/chrono/chrono.hpp>
 #include <boost/chrono/process_cpu_clocks.hpp>
 #include <boost/type_traits/is_same.hpp>
@@ -44,6 +45,36 @@
  */
 //--------------------------------------------------------------------------------------//
 
+    template <class Clock, class Accumulator>
+    struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+        typedef stopwatch_accumulator_formatter type;
+    };
+
+    template <class Clock, class Accumulator>
+    struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+        typedef wstopwatch_accumulator_formatter type;
+    };
+
+    template <class Accumulator>
+    struct stopwatch_reporter_default_formatter<stopwatch_accumulator<process_cpu_clock,Accumulator> > {
+        typedef stopwatch_accumulator_time_formatter type;
+    };
+
+    template <class Accumulator>
+    struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<process_cpu_clock, Accumulator> > {
+        typedef wstopwatch_accumulator_time_formatter type;
+    };
+
+    template <class Accumulator>
+    struct stopwatch_reporter_default_formatter<stopwatch_accumulator<suspendible_clock<process_cpu_clock>, Accumulator> > {
+        typedef stopwatch_reporter_default_formatter<stopwatch_accumulator<process_cpu_clock> >::type  type;
+    };
+
+    template <class Accumulator>
+    struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<suspendible_clock<process_cpu_clock>, Accumulator> > {
+        typedef wstopwatch_reporter_default_formatter<stopwatch_accumulator<process_cpu_clock> >::type  type;
+    };
+
 
     template <class Clock, class Formatter>
     class basic_stopclock_accumulator : public basic_stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> {
@@ -178,7 +209,7 @@
     typedef stopclock_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_stopclock_accumulator;
     typedef stopclock_accumulator< boost::chrono::process_user_cpu_clock > process_user_cpu_stopclock_accumulator;
     typedef stopclock_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_stopclock_accumulator;
-    //typedef stopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_stopclock_accumulator;
+    typedef stopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_stopclock_accumulator;
 
     template <class Clock=high_resolution_clock, class Formatter=typename wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type>
     class wstopclock_accumulator;
@@ -252,7 +283,8 @@
     typedef wstopclock_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_wstopclock_accumulator;
     typedef wstopclock_accumulator< boost::chrono::process_user_cpu_clock > process_user_cpu_wstopclock_accumulator;
     typedef wstopclock_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_wstopclock_accumulator;
-    //typedef wstopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_wstopclock_accumulator;
+    typedef wstopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_wstopclock_accumulator;
+
 
   } // namespace chrono
 } // namespace boost
Modified: sandbox/chrono/boost/chrono/stopwatch.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch.hpp	(original)
+++ sandbox/chrono/boost/chrono/stopwatch.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -13,9 +13,7 @@
 #include <utility>
 #include <boost/chrono/chrono.hpp>
 #include <boost/chrono/stopwatch_scoped.hpp>
-#include <boost/chrono/stopwatch_reporter.hpp>
 #include <boost/system/error_code.hpp>
-#include <boost/chrono/stopwatch_formatter.hpp>
 
 #include <boost/config/abi_prefix.hpp> // must be the last #include
 
@@ -42,16 +40,6 @@
     template <class Clock=high_resolution_clock>
     class stopwatch;
 
-    template <class Clock>
-    struct stopwatch_reporter_default_formatter<stopwatch<Clock> > {
-        typedef stopwatch_formatter type;
-    };
-
-    template <class Clock>
-    struct wstopwatch_reporter_default_formatter<stopwatch<Clock> > {
-        typedef wstopwatch_formatter type;
-    };
-
     struct dont_start_t{};
     static const dont_start_t dont_start = {};
 //--------------------------------------------------------------------------------------//
@@ -183,11 +171,6 @@
         typedef stopwatch_stopper<stopwatch<Clock> > scoped_stop;
         typedef stopwatch_suspender<stopwatch<Clock> > scoped_suspend;
         typedef stopwatch_resumer<stopwatch<Clock> > scoped_resume;
-        template <class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
-        struct get_reporter {
-            typedef stopwatch_reporter<stopwatch<Clock>,Formatter > type;
-        };
-        typedef stopwatch_reporter<stopwatch<Clock> > reporter;
 
     private:
         bool running_;
Modified: sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp	(original)
+++ sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -14,9 +14,7 @@
 
 #include <boost/chrono/chrono.hpp>
 #include <boost/chrono/stopwatch_scoped.hpp>
-#include <boost/chrono/stopwatch_reporter.hpp>
 #include <boost/system/error_code.hpp>
-#include <boost/chrono/stopwatch_accumulator_formatter.hpp>
 #include <boost/accumulators/framework/accumulator_set.hpp>
 #include <boost/accumulators/statistics/sum.hpp>
 #include <boost/accumulators/statistics/min.hpp>
@@ -58,15 +56,6 @@
     >
     class stopwatch_accumulator;
 
-    template <class Clock, class Accumulator>
-    struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
-        typedef stopwatch_accumulator_formatter type;
-    };
-
-    template <class Clock, class Accumulator>
-    struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
-        typedef wstopwatch_accumulator_formatter type;
-    };
 
 //--------------------------------------------------------------------------------------//
     template <class Clock, class Accumulator>
@@ -194,7 +183,7 @@
             suspend_level_=0;
             ec.clear();
         }
-        
+
         accumulator& accumulated( ) { return accumulated_; }
         duration lifetime( system::error_code & ec = system::throws ) {
             return  clock::now( ec ) - construction_;
@@ -204,11 +193,6 @@
         typedef stopwatch_stopper<stopwatch_accumulator<Clock> > scoped_stop;
         typedef stopwatch_suspender<stopwatch_accumulator<Clock> > scoped_suspend;
         typedef stopwatch_resumer<stopwatch_accumulator<Clock> > scoped_resume;
-        template <class Formatter=typename stopwatch_reporter_default_formatter<stopwatch_accumulator>::type>
-        struct get_reporter {
-            typedef stopwatch_reporter<stopwatch_accumulator,Formatter > type;
-        };
-        typedef stopwatch_reporter<stopwatch_accumulator<Clock> > reporter;
     private:
         bool running_;
         bool suspended_;
Added: sandbox/chrono/boost/chrono/stopwatch_accumulator_time_formatter.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/boost/chrono/stopwatch_accumulator_time_formatter.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -0,0 +1,189 @@
+//  boost/chrono/stopwatch_accumulator_time_formatter.hpp  ------------------------------------------------------------//
+
+//  Copyright 2009-2010 Vicente J. Botet Escriba
+
+//  Distributed under the Boost Software License, Version 1.0. (See accompanying
+//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//  See http://www.boost.org/libs/system for documentation.
+
+#ifndef BOOST_CHRONO_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
+#define BOOST_CHRONO_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/system/error_code.hpp>
+#include <boost/current_function.hpp>
+#include <boost/chrono/detail/default_out.hpp>
+#include <boost/chrono/detail/adaptive_string.hpp>
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+#include <boost/accumulators/framework/accumulator_set.hpp>
+#include <boost/accumulators/statistics/sum.hpp>
+#include <boost/accumulators/statistics/min.hpp>
+#include <boost/accumulators/statistics/max.hpp>
+#include <boost/accumulators/statistics/mean.hpp>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <iostream>
+#include <boost/io/ios_state.hpp>
+#include <cstring>
+#include <cassert>
+#include <boost/chrono/time_formatter.hpp>
+
+#include <boost/config/abi_prefix.hpp> // must be the last #include
+
+#define BOOST_CHRONO_ACCUMULATOR_TIME_FORMAT_DEFAULT "%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fHz, lifetime=%ls, percentage=%p%\n"
+
+
+namespace boost { namespace chrono  {
+
+//--------------------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
+
+    template <
+        typename CharT=char,
+        typename Traits=std::char_traits<CharT>,
+        class Alloc=std::allocator<CharT>
+    >
+    class basic_stopwatch_accumulator_time_formatter {
+    public:
+        typedef std::basic_string<CharT,Traits,Alloc> string_type;
+        typedef CharT char_type;
+        typedef std::basic_ostream<CharT,Traits> ostream_type;
+
+        static ostream_type &  default_os();
+        static const char_type* default_format();
+        static string_type format(const char_type* s) {
+            string_type res(s);
+            res += boost::chrono::detail::adaptive_string(" : ");
+            res += default_format();
+            return res;
+        }
+        static int default_places() { return 3; }
+
+        template <class Stopwatch >
+        static void show_time( Stopwatch & stopwatch_, const char_type* format, int places, ostream_type & os, system::error_code & ec)
+        //  NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+        //  be as low as 10, although will be 15 for many common platforms.
+        {
+            typedef typename Stopwatch::accumulator accumulator;
+            typedef typename Stopwatch::duration duration_t;
+            accumulator& acc = stopwatch_.accumulated();
+            duration_t lt= stopwatch_.lifetime();
+
+            //if ( d < duration_t::zero() ) return;
+            if ( places > 9 )
+                places = 9;  // sanity check
+            else if ( places < 0 )
+                places = 0;
+
+            boost::io::ios_flags_saver ifs( os );
+            os.setf( std::ios_base::fixed, std::ios_base::floatfield );
+            boost::io::ios_precision_saver ips( os );
+            os.precision( places );
+
+            const char_type* format2;
+            for (format2=format ; *format2; ++format2 ) {
+                if (*format2=='|') {++format2; break;}
+            }
+
+            for ( ; *format; ++format ) {
+                if ( (*format != '%') || (!*(format+1)) || (!std::strchr("acflmMps", *(format+1))) ) {
+                    os << *format;
+                } else {
+                    ++format;
+                    switch ( *format ) {
+                    case 's':
+                        //~ os << boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count();
+                        time_formatter::show_time<process_cpu_clock>(accumulators::sum(acc), format2, places, os, ec);
+                        //~ os << accumulators::sum(acc);
+                        break;
+                    case 'm':
+                        //~ os << boost::chrono::duration<double>(duration_t((accumulators::min)(acc))).count();
+                        time_formatter::show_time<process_cpu_clock>((accumulators::min)(acc), format2, places, os, ec);
+                        //~ os << (accumulators::min)(acc);
+                        break;
+                    case 'M':
+                        //~ os << boost::chrono::duration<double>(duration_t((accumulators::max)(acc))).count();
+                        time_formatter::show_time<process_cpu_clock>((accumulators::max)(acc), format2, places, os, ec);
+                        //~ os << (accumulators::max)(acc);
+                        break;
+                    case 'a':
+                        if (accumulators::count(acc)>0)
+                         //? os << boost::chrono::duration<double>(duration_t(typename duration_t::rep(accumulators::mean(acc)))).count()
+                                //~ os << boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count() / accumulators::count(acc)
+                            os << accumulators::sum(acc) / accumulators::count(acc);
+                        else
+                            os << 0;
+                        break;
+                    case 'c':
+                        os << accumulators::count(acc);
+                        break;
+                    case 'f':
+                        if (accumulators::count(acc)>0)
+                            //~ os << accumulators::count(acc)/boost::chrono::duration<double>(lt);
+                            os << accumulators::count(acc) << "/" << lt.count();
+                        else
+                            os <<  0;
+                        break;
+                    case 'l':
+                        os << lt.count();
+                        break;
+                    case 'p':
+                        //~ os << int(boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count()*100/boost::chrono::duration<double>(lt).count());
+                        os << accumulators::sum(acc)*100 << "/" << lt.count();
+                        break;
+                    default:
+                        assert(0 && "basic_stopwatch_accumulator_time_formatter internal logic error");
+                    }
+                }
+            }
+        }
+    };
+
+namespace detail {
+    template <typename CharT>
+    struct basic_stopwatch_accumulator_time_formatter_default_format;
+    template <>
+    struct basic_stopwatch_accumulator_time_formatter_default_format<char> {
+        static const char* apply() {return BOOST_CHRONO_ACCUMULATOR_TIME_FORMAT_DEFAULT; }
+    };
+#ifndef BOOST_NO_STD_WSTRING
+    template <>
+    struct basic_stopwatch_accumulator_time_formatter_default_format<wchar_t> {
+        static const wchar_t* apply() {return L"%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fHz, lifetime=%ls, percentage=%p%\n"; }
+    };
+
+#endif
+}
+
+    template <typename CharT,typename Traits, class Alloc>
+    const typename basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::char_type*
+    basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::default_format() {
+        return detail::basic_stopwatch_accumulator_time_formatter_default_format<CharT>::apply();
+    }
+
+    template <typename CharT,typename Traits, class Alloc>
+    typename basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::ostream_type &
+    basic_stopwatch_accumulator_time_formatter<CharT,Traits,Alloc>::default_os()  { return detail::default_out<CharT,Traits>::apply(); }
+
+    typedef basic_stopwatch_accumulator_time_formatter<char> stopwatch_accumulator_time_formatter;
+    typedef basic_stopwatch_accumulator_time_formatter<wchar_t> wstopwatch_accumulator_time_formatter;
+
+
+
+
+} // namespace chrono
+} // namespace boost
+
+#define BOOST_CHRONO_ACCUMULATOR_TIME_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_CHRONO_ACCUMULATOR_FORMAT_DEFAULT)
+#ifdef __GNUC__
+#define BOOST_CHRONO_ACCUMULATOR_TIME_FUNCTION_FORMAT boost::chrono::stopwatch_accumulator_time_formatter::format(BOOST_CURRENT_FUNCTION)
+#else
+#define BOOST_CHRONO_ACCUMULATOR_TIME_FUNCTION_FORMAT BOOST_CHRONO_ACCUMULATOR_TIME_FORMAT(BOOST_CURRENT_FUNCTION)
+#endif
+
+
+#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
+
+#endif
Modified: sandbox/chrono/boost/chrono/stopwatches.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatches.hpp	(original)
+++ sandbox/chrono/boost/chrono/stopwatches.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -16,10 +16,10 @@
 //-----------------------------------------------------------------------------
 #include <boost/chrono/t24_hours.hpp>
 #include <boost/chrono/t24_hours_formatter.hpp>
-#include <boost/chrono/scoped_stopclock.hpp>
 #include <boost/chrono/process_cpu_clocks.hpp>
 #include <boost/chrono/stopclock.hpp>
 #include <boost/chrono/stopclock_accumulator.hpp>
+#include <boost/chrono/scoped_stopclock.hpp>
 #include <boost/chrono/stopwatch.hpp>
 #include <boost/chrono/stopwatch_accumulator.hpp>
 #include <boost/chrono/stopwatch_accumulator_formatter.hpp>
@@ -27,6 +27,7 @@
 #include <boost/chrono/stopwatch_reporter.hpp>
 #include <boost/chrono/stopwatch_scoped.hpp>
 #include <boost/chrono/time_formatter.hpp>
+#include <boost/chrono/stopwatch_accumulator_time_formatter.hpp>
 //-----------------------------------------------------------------------------
 
 #endif // BOOST_CHRONO_STOPWATCHES_HPP
Modified: sandbox/chrono/boost/chrono/time_formatter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/time_formatter.hpp	(original)
+++ sandbox/chrono/boost/chrono/time_formatter.hpp	2010-08-17 19:51:12 EDT (Tue, 17 Aug 2010)
@@ -63,7 +63,7 @@
         static int default_places() { return 3; }
 
         template <class Stopwatch >
-        static void show_time( Stopwatch & stopwatch_
+        static void show_time( typename Stopwatch::duration::rep const & times
             , const char_type* format, int places, ostream_type & os
             , system::error_code & ec)
           //  NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
@@ -71,8 +71,6 @@
           {
             typedef typename Stopwatch::duration duration;
             typedef typename duration::rep rep;
-            duration d = stopwatch_.elapsed( ec );
-            rep times=d.count();
             if ( times.real < 0 ) return;
             if ( places > 9 )
               places = 9;  // sanity check
@@ -119,12 +117,25 @@
                   }
                   break;
                 default:
-                  assert(0 && "run_timer internal logic error");
+                  assert(0 && "basic_time_formatter internal logic error");
                 }
               }
             }
           }
 
+        template <class Stopwatch >
+        static void show_time( Stopwatch & stopwatch_
+            , const char_type* format, int places, ostream_type & os
+            , system::error_code & ec)
+          //  NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
+          //  be as low as 10, although will be 15 for many common platforms.
+        {
+            typedef typename Stopwatch::duration duration;
+            typedef typename duration::rep rep;
+            duration d = stopwatch_.elapsed( ec );
+            rep times=d.count();
+            show_time<Stopwatch>(times, format, places, os, ec);
+        }
     };
 
 namespace detail {
@@ -158,16 +169,6 @@
     typedef basic_time_formatter<char> time_formatter;
     typedef basic_time_formatter<wchar_t> wtime_formatter;
 
-    template <>
-    struct stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> > {
-        typedef time_formatter type;
-    };
-
-    template <>
-    struct stopwatch_reporter_default_formatter<stopwatch<suspendible_clock<process_cpu_clock> > > {
-        typedef stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> >::type  type;
-    };
-    
   } // namespace chrono
 } // namespace boost