code_profiler
src
main.cpp
Go to the documentation of this file.
1
#define PROFILEAPP
2
#include "
profiling/Timer.h
"
3
#include "
profiling/Profiler.h
"
4
#include <
iostream
>
5
6
Timer
t
;
7
int
testProf
()
8
{
/*
9
ThreadProfiler::Start("ProfileThis");
10
int i = sleep(1);
11
ThreadProfiler::Start("ProfileThis2");
12
sleep(2);
13
ThreadProfiler::Stop("ProfileThis2");
14
ThreadProfiler::Stop("ProfileThis");*/
15
t
.
start
();
16
ThreadProfiler::Start
(
"Bla"
);
17
ThreadProfiler::Stop
(
"Bla"
);
18
t
.
stop
();
19
std::cout
<<
"Elapsed: "
<<
t
.
getElapsedTimeInMilliSec
() <<
std::endl
;
20
return
0;
21
}
22
23
void
testProf2
()
24
{
25
boost::thread t1(&
testProf
);
26
t1.join();
27
boost::thread t2(&
testProf
);
28
t2.join();
29
}
30
31
int
main
()
32
{
33
return
testProf
();
34
}
t
Timer t
Definition:
main.cpp:6
ThreadProfiler::Start
static void Start(std::string name)
Definition:
Profiler.h:156
iostream
Timer
Definition:
Timer.h:28
std::cout
ThreadProfiler::Stop
static void Stop(std::string name)
Definition:
Profiler.h:157
Timer::start
void start()
Definition:
Timer.cpp:50
Timer.h
main
int main()
Definition:
main.cpp:31
Timer::getElapsedTimeInMilliSec
double getElapsedTimeInMilliSec() const
Definition:
Timer.cpp:111
testProf2
void testProf2()
Definition:
main.cpp:23
std::endl
T endl(T... args)
Profiler.h
testProf
int testProf()
Definition:
main.cpp:7
Timer::stop
void stop()
Definition:
Timer.cpp:66
Generated on Sun Feb 23 2025 04:33:26 for code_profiler by
1.8.17