Nymph
v1.5.2
Flow-Based Data Processing Framework
Executables
Validation
TestThroughputProfiler.cc
Go to the documentation of this file.
1
/*
2
* TestThroughputProfiler.cc
3
*
4
* Created on: Dec 2, 2012
5
* Author: nsoblath
6
*/
7
8
#include "
KTLogger.hh
"
9
#include "
KTThroughputProfiler.hh
"
10
11
using namespace
Nymph
;
12
13
KTLOGGER
(testlog,
"TestThroughputProfiler"
);
14
15
int
main
()
16
{
17
KTThroughputProfiler
prof;
18
19
unsigned
nIterations = 1000000;
20
unsigned
sum = 0;
21
KTINFO
(testlog,
"Test 1: "
<< nIterations <<
" iterations"
);
22
prof.
Start
();
23
for
(
unsigned
i=0; i<nIterations; i++)
24
{
25
sum++;
26
}
27
prof.
Stop
();
28
timespec diff = prof.
Elapsed
();
29
KTINFO
(testlog,
"Elapsed time: "
<< diff.tv_sec <<
" sec and "
<< diff.tv_nsec <<
" nsec"
);
30
31
nIterations = 5000000;
32
sum = 0;
33
KTINFO
(testlog,
"Test 2: "
<< nIterations <<
" iterations"
);
34
prof.
Start
();
35
for
(
unsigned
i=0; i<nIterations; i++)
36
{
37
sum++;
38
}
39
prof.
Stop
();
40
diff = prof.
Elapsed
();
41
KTINFO
(testlog,
"Elapsed time: "
<< diff.tv_sec <<
" sec and "
<< diff.tv_nsec <<
" nsec"
);
42
43
return
0;
44
}
45
Nymph::KTThroughputProfiler::Elapsed
timespec Elapsed()
Definition:
KTThroughputProfiler.cc:62
main
int main()
Definition:
TestThroughputProfiler.cc:15
KTINFO
#define KTINFO(...)
Definition:
KTLogger.hh:344
Nymph::KTThroughputProfiler
Measures the speed of data processing.
Definition:
KTThroughputProfiler.hh:77
Nymph::KTThroughputProfiler::Stop
void Stop()
Definition:
KTThroughputProfiler.cc:55
Nymph
Definition:
KTApplication.cc:21
KTThroughputProfiler.hh
Nymph::KTLOGGER
KTLOGGER(applog, "KTApplication")
Nymph::KTThroughputProfiler::Start
void Start()
Definition:
KTThroughputProfiler.cc:48
KTLogger.hh
Contains the logger class and macros, based on Kasper's KLogger class.
Generated by
1.8.13