2 #pragma warning(disable : 4251) 14 #define PP_CAT(a, b) PP_CAT_I(a, b) 15 #define PP_CAT_I(a, b) PP_CAT_II(~, a##b) 16 #define PP_CAT_II(p, res) res 18 #define PP_UNIQUE_NAME(base) PP_CAT(base, __COUNTER__) 20 #define PROFILECLEAR \ 22 Base::Timer::clearAll(); \ 24 #define PROFILEENABLE(a) \ 26 Base::Timer::enable(a); \ 28 #define PROFILESTART(a) \ 30 Base::Timer::profileStart(a); \ 32 #define PROFILESTOP(a) \ 34 Base::Timer::profileStop(a); \ 36 #define PROFILESCOPED(a) Base::scopedProfile PP_UNIQUE_NAME(scopedProfile__)(a); 41 #define PROFILEENABLE(a) 42 #define PROFILESTART(a) 43 #define PROFILESTOP(a) 44 #define PROFILESCOPED(a) 50 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 55 virtual void resetTotal() = 0;
56 virtual void reset() = 0;
57 virtual double elapsedMS() = 0;
58 virtual double elapsed()
const = 0;
59 virtual double start() = 0;
60 virtual void restart() = 0;
61 virtual double stop() = 0;
62 virtual double totalSeconds() = 0;
63 virtual double totalMS() = 0;
64 virtual long count() = 0;
65 virtual std::string getName() = 0;
66 virtual timerIFace* getParent() = 0;
67 virtual void setParent(timerIFace*) = 0;
68 virtual void addChild(timerIFace*) = 0;
69 virtual std::set<timerIFace*> getChildren() = 0;
78 double elapsedMS() {
return 0.0; };
79 double elapsed()
const {
return 0.0; };
80 double start() {
return 0.0; };
82 double stop() {
return 0.0; };
83 double totalSeconds() {
return 0.0; };
84 double totalMS() {
return 0.0; };
85 long count() {
return 0; };
86 std::string getName() {
return std::string(); };
87 timerIFace* getParent() {
return 0; };
88 void setParent(timerIFace*){};
89 void addChild(timerIFace*){};
90 std::set<timerIFace*> getChildren() {
return std::set<timerIFace*>(); };
104 double elapsed()
const;
108 double totalSeconds();
111 double createdTime();
112 std::string getName() {
return _name; };
113 void setParent(timerIFace*);
114 timerIFace* getParent();
117 void addChild(timerIFace* c) { _children.insert(c); };
118 std::set<timerIFace*> getChildren() {
return _children; };
120 static timerIFace* getTimer(std::string
name);
121 static void stopTimer(std::string
name);
122 static std::map<std::string, timerIFace*> getTimerMap();
123 static void setCurrent(timerIFace* p);
124 static timerIFace* getCurrent();
126 static void clearAll();
127 double startTiming();
128 static std::map<void*, double> TimeStorage;
130 static void enable(
bool v);
131 static bool isEnabled();
134 static void profileStart(
const char* a);
135 static void profileStop(
const char* a);
137 static void printTimer(
char* header);
143 double _totalseconds;
146 timerIFace* _parentTimer = 0;
147 std::set<timerIFace*> _children;
148 static timerIFace* _currentTimer;
149 static bool _enabled;
150 static std::map<std::string, timerIFace*> _timerMap;
153 static Base::timer_dummy my_timer_dummy;
154 static Base::timer_dummy* my_timer_dummy_ptr = &my_timer_dummy;
165 double elapsed()
const {
return double(clock() - _start_time) / CLOCKS_PER_SEC; }
#define PROFILESTOP(a)
Definition: Timer.h:32
void restart()
Definition: Timer.h:164
#define BASE_EXPORT
Definition: base_defines.h:12
Core::PropertyText name
Definition: CoreDocument.h:143
timer()
Definition: Timer.h:163
double elapsed() const
Definition: Timer.h:165
#define PROFILESTART(a)
Definition: Timer.h:28
~scopedProfile()
Definition: Timer.h:175
Definition: AbstractXMLReader.h:8
std::string m_name
Definition: Timer.h:177
scopedProfile(const char *a)
Definition: Timer.h:174