test_timekeeper.cxx
Go to the documentation of this file.
1 /** Test the WireCellUtil/Testing helpers.
2  */
3 
4 #include "WireCellUtil/Testing.h"
6 
7 #include <unistd.h> // fixme: maybe a more modern sleep() is preferable?
8 #include <iostream>
9 
10 using namespace WireCell;
11 using namespace std;
12 
13 int main(int argc, char** argv)
14 {
15  TimeKeeper tk("test_testing");
16  cout << tk("sleeping") << endl;;
17  sleep(1);
18  cout << tk("awake") << endl;
19 
21  AssertMsg(dt.seconds() == 1, "Bad sleep.");
22 
23  cout << "TimeKeeper summary: " << endl;
24  cout << tk.summary() << endl;
25 }
int main(int argc, char **argv)
STL namespace.
deltat last_duration() const
Return the duration between the last two events.
Definition: TimeKeeper.cxx:31
Definition: Main.h:22
std::string summary() const
Return summary up to now.
Definition: TimeKeeper.cxx:48
#define AssertMsg
Definition: Testing.h:8
boost::posix_time::time_duration deltat
Definition: TimeKeeper.h:24
QTextStream & endl(QTextStream &s)