source: src/base/timer.hpp@ dfed1c

Last change on this file since dfed1c was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 910 bytes
Line 
1/**
2 * @file timer.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Tue Sep 6 16:17:40 2011
5 *
6 * @brief Class to measure timings.
7 *
8 */
9
10#ifndef TIMER_HPP_
11#define TIMER_HPP_
12
13#include <map>
14#include <string>
15
16#include "thirdparty/pugixml/pugixml.hpp"
17
18namespace VMG
19{
20
21struct TimerData
22{
23 TimerData():
24 time_start(0.0),
25 duration(0.0),
26 warning(0),
27 total(0)
28 {}
29
30 double time_start;
31 double duration;
32 int warning;
33 int total;
34};
35
36class Timer
37{
38public:
39 Timer() {}
40 ~Timer() {}
41
42 static void Start(std::string event);
43 static void Stop(std::string event);
44 static void Clear();
45
46 static pugi::xml_node ToXMLNode();
47 static std::string ToString();
48 static void Print();
49
50 static std::map<std::string, TimerData> td;
51
52private:
53 static std::string active_timer;
54};
55
56std::ostream& operator<<(std::ostream& out, const Timer&);
57
58}
59
60#endif /* TIMER_HPP_ */
61
Note: See TracBrowser for help on using the repository browser.