29 #if !defined( FEELPP_TIMING_TIMER_HPP)
30 #define FEELPP_TIMING_TIMER_HPP 1
34 #include <boost/assert.hpp>
44 template<
class R,
class T>
class counter
52 times().push( time() );
55 type toc( std::string
const& msg,
bool display )
const
57 BOOST_ASSERT_MSG( !empty(),
"Unbalanced timing calls" );
58 type t = time()-times().top();
61 if ( display ) timer_type::print( msg, t );
68 return times().empty();
72 return timer_type::time();
75 std::stack<type>& times()
const
77 static std::stack<type> local;