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
26 
27 using namespace icl_core::perf_mon;
28 
29 int main(int argc, char* argv[])
30 {
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 
50  return 0;
51 }
unsigned int uint32_t
Definition: msvc_stdint.h:93
bool initialize(int &argc, char *argv[], bool remove_read_arguments)
#define PERF_MON_ADD_STATIC_DATA_P(description, data, prefix)
#define PERF_MON_PRINT_INFO_P(timer_name, description, prefix)
#define PERF_MON_SUMMARY_ALL_INFO
#define PERF_MON_PRINT_AND_RESET_INFO(timer_name, description)
int main(int argc, char *argv[])
#define PERF_MON_ENABLE(prefix)
int usleep(unsigned long useconds)
Definition: os_time.h:56
#define PERF_MON_START(timer_name)
#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.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58