code_profiler
test
test_profiler.cpp
Go to the documentation of this file.
1
#include <
tue/profiling/profiler.h
>
2
#include <
tue/profiling/scoped_timer.h
>
3
4
tue::Profiler
profiler
;
5
6
void
a
()
7
{
8
tue::ScopedTimer
t
(
profiler
,
"a"
);
9
}
10
11
void
b
()
12
{
13
tue::ScopedTimer
t
(
profiler
,
"b"
);
14
a
();
15
}
16
17
void
c
()
18
{
19
tue::ScopedTimer
t
(
profiler
,
"c"
);
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
39
profiler
.
stopTimer
();
40
41
std::cout
<<
profiler
<<
std::endl
;
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
Generated on Sun Feb 23 2025 04:33:26 for code_profiler by
1.8.17