Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_timekeeper.cxx
Go to the documentation of this file.
1
/** Test the WireCellUtil/Testing helpers.
2
*/
3
4
#include "
WireCellUtil/Testing.h
"
5
#include "
WireCellUtil/TimeKeeper.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
20
TimeKeeper::deltat
dt = tk.
last_duration
();
21
AssertMsg
(dt.seconds() == 1,
"Bad sleep."
);
22
23
cout <<
"TimeKeeper summary: "
<<
endl
;
24
cout << tk.
summary
() <<
endl
;
25
}
main
int main(int argc, char **argv)
Definition:
test_timekeeper.cxx:13
std
STL namespace.
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
TimeKeeper.h
Testing.h
WireCell::TimeKeeper::last_duration
deltat last_duration() const
Return the duration between the last two events.
Definition:
TimeKeeper.cxx:31
WireCell
Definition:
Main.h:22
WireCell::TimeKeeper::summary
std::string summary() const
Return summary up to now.
Definition:
TimeKeeper.cxx:48
AssertMsg
#define AssertMsg
Definition:
Testing.h:8
WireCell::TimeKeeper
Definition:
TimeKeeper.h:21
test_gen_rays_pdsp.argc
argc
Definition:
test_gen_rays_pdsp.py:6
WireCell::TimeKeeper::deltat
boost::posix_time::time_duration deltat
Definition:
TimeKeeper.h:24
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11