1 #ifndef ACCUMULATED_TIMER_H 2 #define ACCUMULATED_TIMER_H 5 #include <boost/shared_ptr.hpp> 6 #include <boost/noncopyable.hpp> 7 #include <boost/timer.hpp> 33 double elapsed()
const {
return elapsed_; }
46 void print(std::ostream& Os)
const 47 { Os << desc <<
" elapsed time " <<
elapsed(); }
49 mutable double elapsed_;
60 : at(At), auto_log(Auto_log) {}
63 at.elapsed_ += t.elapsed();
65 Logger::info() <<
"Current: " << at.desc <<
" elapsed time " 66 << t.elapsed() <<
"\n";
AccumulatedTimer(const std::string &Desc)
Create an AccumulatedTimer.
void reset_elapsed()
Reset elapsed time to 0.
Helper class for AccumulatedTimer.
This is a Mixin for classes that can be printed.
FunctionTimer function_timer(bool Auto_log=false) const
Function timer.
FunctionTimer(const AccumulatedTimer &At, bool Auto_log)
This is a simple timer class that can be used to accumulate the time spent in multiple calls to a fun...
Contains classes to abstract away details in various Spurr Radiative Transfer software.
void print(std::ostream &Os) const
Helper class for AccumulatedTimer.
FunctionTimerR(const AccumulatedTimer &At, bool Auto_log)
double elapsed() const
Total elapsed time.