example_usage.cpp
Go to the documentation of this file.
00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
00002 
00003 // -- BEGIN LICENSE BLOCK ----------------------------------------------
00004 // This file is part of FZIs ic_workspace.
00005 //
00006 // This program is free software licensed under the LGPL
00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
00008 // You can find a copy of this license in LICENSE folder in the top
00009 // directory of the source code.
00010 //
00011 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
00012 //
00013 // -- END LICENSE BLOCK ------------------------------------------------
00014 
00015 //----------------------------------------------------------------------
00022 //----------------------------------------------------------------------
00023 
00024 #define IC_PERFORMANCE_MONITOR
00025 #include "icl_core_performance_monitor/PerformanceMonitor.h"
00026 
00027 using namespace icl_core::perf_mon;
00028 
00029 int main(int argc, char* argv[])
00030 {
00031   icl_core::logging::initialize(argc, argv);
00032   PERF_MON_INITIALIZE(10, 1000);
00033 
00034   PERF_MON_START("test_timer");
00035   PERF_MON_START("all");
00036   PERF_MON_ENABLE("all_prefix");
00037   PERF_MON_ADD_STATIC_DATA_P("number of runs", 9.0, "all_prefix");
00038   for (size_t i=1; i < 10; ++i)
00039   {
00040     // do some work
00041     uint32_t j = i / i;
00042     j++;
00043     icl_core::os::usleep(110000);
00044     PERF_MON_PRINT_AND_RESET_INFO("test_timer", "event");
00045   }
00046 
00047   PERF_MON_PRINT_INFO_P("all", "over", "all_prefix");
00048 
00049   PERF_MON_SUMMARY_ALL_INFO;
00050   return 0;
00051 }


fzi_icl_core
Author(s):
autogenerated on Thu Jun 6 2019 20:22:23