Monero
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
perf_timer.h File Reference
#include <cstdint>
#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

namespace  tools
 Various Tools.
 

Macros

#define PERF_TIMER_NAME(name)   pt_##name
 
#define PERF_TIMER_UNIT(name, unit)   tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level)
 
#define PERF_TIMER_UNIT_L(name, unit, l)   tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)t_##name(#name, "perf." MONERO_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> PERF_TIMER_NAME(name)(new tools::LoggingPerformanceTimer(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, el::Level::Info))
 
#define PERF_TIMER_START(name)   PERF_TIMER_START_UNIT(name, 1000000)
 
#define PERF_TIMER_STOP(name)   do { PERF_TIMER_NAME(name).reset(NULL); } while(0)
 
#define PERF_TIMER_PAUSE(name)   PERF_TIMER_NAME(name).pause()
 
#define PERF_TIMER_RESUME(name)   PERF_TIMER_NAME(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)

◆ PERF_TIMER_L

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

◆ PERF_TIMER_NAME

#define PERF_TIMER_NAME ( name)    pt_##name

◆ PERF_TIMER_PAUSE

#define PERF_TIMER_PAUSE ( name)    PERF_TIMER_NAME(name).pause()

◆ PERF_TIMER_RESUME

#define PERF_TIMER_RESUME ( name)    PERF_TIMER_NAME(name).resume()

◆ PERF_TIMER_START

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

◆ PERF_TIMER_START_UNIT

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

◆ PERF_TIMER_STOP

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

◆ PERF_TIMER_UNIT

◆ PERF_TIMER_UNIT_L

#define PERF_TIMER_UNIT_L ( name,
unit,
l )   tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)t_##name(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, l)