Electroneum
perf_timer.h File Reference
#include <string>
#include <stdio.h>
#include <memory>
#include "misc_log_ex.h"
Include dependency graph for perf_timer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tools::PerformanceTimer
 
class  tools::LoggingPerformanceTimer
 

Namespaces

 tools
 Various Tools.
 

Macros

#define PERF_TIMER_UNIT(name, unit)   tools::LoggingPerformanceTimer pt_##name(#name, "perf." ELECTRONEUM_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level)
 
#define PERF_TIMER_UNIT_L(name, unit, l)   tools::LoggingPerformanceTimer pt_##name(#name, "perf." ELECTRONEUM_DEFAULT_LOG_CATEGORY, unit, l)
 
#define PERF_TIMER(name)   PERF_TIMER_UNIT(name, 1000000)
 
#define PERF_TIMER_L(name, l)   PERF_TIMER_UNIT_L(name, 1000000, l)
 
#define PERF_TIMER_START_UNIT(name, unit)   std::unique_ptr<tools::LoggingPerformanceTimer> pt_##name(new tools::LoggingPerformanceTimer(#name, "perf." ELECTRONEUM_DEFAULT_LOG_CATEGORY, unit, el::Level::Info))
 
#define PERF_TIMER_START(name)   PERF_TIMER_START_UNIT(name, 1000000)
 
#define PERF_TIMER_STOP(name)   do { pt_##name.reset(NULL); } while(0)
 
#define PERF_TIMER_PAUSE(name)   pt_##name->pause()
 
#define PERF_TIMER_RESUME(name)   pt_##name->resume()
 

Functions

uint64_t tools::get_tick_count ()
 
uint64_t tools::get_ticks_per_ns ()
 
uint64_t tools::ticks_to_ns (uint64_t ticks)
 
void tools::set_performance_timer_log_level (el::Level level)
 

Macro Definition Documentation

◆ PERF_TIMER

#define PERF_TIMER (   name)    PERF_TIMER_UNIT(name, 1000000)

Definition at line 82 of file perf_timer.h.

◆ PERF_TIMER_L

#define PERF_TIMER_L (   name,
 
)    PERF_TIMER_UNIT_L(name, 1000000, l)

Definition at line 83 of file perf_timer.h.

◆ PERF_TIMER_PAUSE

#define PERF_TIMER_PAUSE (   name)    pt_##name->pause()

Definition at line 87 of file perf_timer.h.

◆ PERF_TIMER_RESUME

#define PERF_TIMER_RESUME (   name)    pt_##name->resume()

Definition at line 88 of file perf_timer.h.

◆ PERF_TIMER_START

#define PERF_TIMER_START (   name)    PERF_TIMER_START_UNIT(name, 1000000)

Definition at line 85 of file perf_timer.h.

◆ PERF_TIMER_START_UNIT

#define PERF_TIMER_START_UNIT (   name,
  unit 
)    std::unique_ptr<tools::LoggingPerformanceTimer> pt_##name(new tools::LoggingPerformanceTimer(#name, "perf." ELECTRONEUM_DEFAULT_LOG_CATEGORY, unit, el::Level::Info))

Definition at line 84 of file perf_timer.h.

◆ PERF_TIMER_STOP

#define PERF_TIMER_STOP (   name)    do { pt_##name.reset(NULL); } while(0)

Definition at line 86 of file perf_timer.h.

◆ PERF_TIMER_UNIT

#define PERF_TIMER_UNIT (   name,
  unit 
)    tools::LoggingPerformanceTimer pt_##name(#name, "perf." ELECTRONEUM_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level)

Definition at line 80 of file perf_timer.h.

◆ PERF_TIMER_UNIT_L

#define PERF_TIMER_UNIT_L (   name,
  unit,
 
)    tools::LoggingPerformanceTimer pt_##name(#name, "perf." ELECTRONEUM_DEFAULT_LOG_CATEGORY, unit, l)

Definition at line 81 of file perf_timer.h.