code_profiler
test_profiler.cpp
Go to the documentation of this file.
3 
5 
6 void a()
7 {
9 }
10 
11 void b()
12 {
14  a();
15 }
16 
17 void c()
18 {
20  b();
21  a();
22 }
23 
24 int main()
25 {
26  profiler.setName("test");
27 
28  profiler.startTimer("total");
29 
30  for(unsigned int i = 0; i < 1000; ++i)
31  {
32  tue::ScopedTimer t_iteration(profiler, "iteration");
33 
34  a();
35  b();
36  c();
37  }
38 
40 
42 
43  return 0;
44 }
tue::Profiler::stopTimer
void stopTimer()
Definition: profiler.cpp:64
t
Timer t
Definition: main.cpp:6
a
void a()
Definition: test_profiler.cpp:6
tue::Profiler::startTimer
void startTimer(const std::string &name)
Definition: profiler.cpp:38
std::cout
profiler.h
profiler
tue::Profiler profiler
Definition: test_profiler.cpp:4
tue::Profiler
Definition: profiler.h:11
b
void b()
Definition: test_profiler.cpp:11
std::endl
T endl(T... args)
scoped_timer.h
c
void c()
Definition: test_profiler.cpp:17
main
int main()
Definition: test_profiler.cpp:24
tue::Profiler::setName
void setName(const std::string &name)
Definition: profiler.h:22
tue::ScopedTimer
Definition: scoped_timer.h:11