Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
icl_core
src
icl_core_performance_monitor
example_usage.cpp
Go to the documentation of this file.
1
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2
3
// -- BEGIN LICENSE BLOCK ----------------------------------------------
4
// This file is part of FZIs ic_workspace.
5
//
6
// This program is free software licensed under the LGPL
7
// (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8
// You can find a copy of this license in LICENSE folder in the top
9
// directory of the source code.
10
//
11
// © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12
//
13
// -- END LICENSE BLOCK ------------------------------------------------
14
15
//----------------------------------------------------------------------
22
//----------------------------------------------------------------------
23
24
#define IC_PERFORMANCE_MONITOR
25
#include "
icl_core_performance_monitor/PerformanceMonitor.h
"
26
27
using namespace
icl_core::perf_mon
;
28
29
int
main
(
int
argc,
char
* argv[])
30
{
31
icl_core::logging::initialize
(argc, argv);
32
PERF_MON_INITIALIZE
(10, 1000);
33
34
PERF_MON_START
(
"test_timer"
);
35
PERF_MON_START
(
"all"
);
36
PERF_MON_ENABLE
(
"all_prefix"
);
37
PERF_MON_ADD_STATIC_DATA_P
(
"number of runs"
, 9.0,
"all_prefix"
);
38
for
(
size_t
i=1; i < 10; ++i)
39
{
40
// do some work
41
uint32_t
j = i / i;
42
j++;
43
icl_core::os::usleep
(110000);
44
PERF_MON_PRINT_AND_RESET_INFO
(
"test_timer"
,
"event"
);
45
}
46
47
PERF_MON_PRINT_INFO_P
(
"all"
,
"over"
,
"all_prefix"
);
48
49
PERF_MON_SUMMARY_ALL_INFO
;
50
return
0;
51
}
uint32_t
unsigned int uint32_t
Definition:
msvc_stdint.h:93
icl_core::logging::initialize
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
Definition:
icl_core_logging/Logging.cpp:100
PerformanceMonitor.h
PERF_MON_ADD_STATIC_DATA_P
#define PERF_MON_ADD_STATIC_DATA_P(description, data, prefix)
Definition:
PerformanceMonitorMacros.h:185
PERF_MON_PRINT_INFO_P
#define PERF_MON_PRINT_INFO_P(timer_name, description, prefix)
Definition:
PerformanceMonitorMacros.h:164
PERF_MON_SUMMARY_ALL_INFO
#define PERF_MON_SUMMARY_ALL_INFO
Definition:
PerformanceMonitorMacros.h:181
PERF_MON_PRINT_AND_RESET_INFO
#define PERF_MON_PRINT_AND_RESET_INFO(timer_name, description)
Definition:
PerformanceMonitorMacros.h:169
main
int main(int argc, char *argv[])
Definition:
example_usage.cpp:29
PERF_MON_ENABLE
#define PERF_MON_ENABLE(prefix)
Definition:
PerformanceMonitorMacros.h:159
icl_core::os::usleep
int usleep(unsigned long useconds)
Definition:
os_time.h:56
PERF_MON_START
#define PERF_MON_START(timer_name)
Definition:
PerformanceMonitorMacros.h:158
PERF_MON_INITIALIZE
#define PERF_MON_INITIALIZE(num_names, num_events)
These macros help using the performance monitor. Most macros are defined for INFO, DEBUG and TRACE logging level. DEBUG and TRACE are ignored by the compiler if IC_DEBUG is not defined.
Definition:
PerformanceMonitorMacros.h:157
icl_core::perf_mon
Definition:
PerformanceMonitor.cpp:35
fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58