ExecMon.cxx
Go to the documentation of this file.
1 #include "WireCellUtil/ExecMon.h"
2 #include <sstream>
3 
4 using namespace WireCell;
5 
7  : tk(msg, starting_time)
8  , mu(msg) { }
9 
11 
13 {
14  std::stringstream ss;
15  ss << "Time: " << tk(msg,now) << "\n"
16  << "Memory: " << mu(msg,mumu);
17  return ss.str();
18 }
19 
20 
22 {
23  std::stringstream ss;
24  ss << "Time summary:\n" << tk.summary() << "\nMemory usage:\n" << mu.summary();
25  return ss.str();
26 }
27 
MemUsage mu
Definition: ExecMon.h:38
void msg(const char *fmt,...)
Definition: message.cpp:107
std::string string
Definition: nybbler.cc:12
std::string operator()(std::string msg="<tick>", TimeKeeper::ptime now=boost::posix_time::microsec_clock::local_time(), MemUsage::memusage mu=MemUsage::memusage(-1,-1))
Record an event.
Definition: ExecMon.cxx:12
boost::posix_time::ptime ptime
Definition: TimeKeeper.h:23
Definition: Main.h:22
std::pair< double, double > memusage
Definition: MemUsage.h:21
std::string summary() const
Return summary up to now.
Definition: MemUsage.cxx:101
std::string summary() const
Return summary up to now.
Definition: TimeKeeper.cxx:48
ExecMon(const std::string &msg="start", TimeKeeper::ptime starting_time=boost::posix_time::microsec_clock::local_time())
Definition: ExecMon.cxx:6
std::string summary() const
Return summary up to now.
Definition: ExecMon.cxx:21
TimeKeeper tk
Definition: ExecMon.h:37