diff options
| author | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
| commit | e0737c56c1e384e05064a0c6e1ac46979371041b (patch) | |
| tree | a0123d694a2d36c43dabdf0a3907392fce11d457 /boost/libs/timer/src/auto_timers_construction.cpp | |
| parent | b4aebf2d137b892f53503b13785ecae900062ff7 (diff) | |
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'boost/libs/timer/src/auto_timers_construction.cpp')
| -rw-r--r-- | boost/libs/timer/src/auto_timers_construction.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/boost/libs/timer/src/auto_timers_construction.cpp b/boost/libs/timer/src/auto_timers_construction.cpp new file mode 100644 index 00000000..b23b5467 --- /dev/null +++ b/boost/libs/timer/src/auto_timers_construction.cpp @@ -0,0 +1,46 @@ +// boost auto_timers_construction.cpp ------------------------------------------------// + +// Copyright Beman Dawes 2007, 2011 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/timer for documentation. + +//--------------------------------------------------------------------------------------// + +// These constructors are in a separate file so that this translation unit will +// not be linked in except when one of the constructors is actually used. This +// is important since header <iostream> is required, and it incurs the cost of +// the standard stream objects even if they are not used. + +//--------------------------------------------------------------------------------------// + +// define BOOST_TIMER_SOURCE so that <boost/timer/config.hpp> knows +// the library is being built (possibly exporting rather than importing code) +#define BOOST_TIMER_SOURCE + +#include <boost/timer/timer.hpp> +#include <iostream> + +namespace +{ + // CAUTION: must be identical to same constant in cpu_timer.cpp + const std::string default_fmt(" %ws wall, %us user + %ss system = %ts CPU (%p%)\n"); +} + +namespace boost +{ + namespace timer + { + auto_cpu_timer::auto_cpu_timer(short places) // #1 + : m_places(places), m_os(&std::cout), m_format(default_fmt) { start(); } + + auto_cpu_timer::auto_cpu_timer(short places, const std::string& format) // #2 + : m_places(places), m_os(&std::cout), m_format(format) { start(); } + + auto_cpu_timer::auto_cpu_timer(const std::string& format) // #3 + : m_places(default_places), m_os(&std::cout), m_format(format) { start(); } + + } // namespace timer +} // namespace boost |
