Electroneum
Loading...
Searching...
No Matches
tools::PerformanceTimer Class Reference

#include <perf_timer.h>

Inheritance diagram for tools::PerformanceTimer:

Public Member Functions

 PerformanceTimer (bool paused=false)
 ~PerformanceTimer ()
void pause ()
void resume ()
void reset ()
uint64_t value () const
 operator uint64_t () const

Protected Attributes

uint64_t ticks
bool started
bool paused

Detailed Description

Definition at line 48 of file perf_timer.h.

Constructor & Destructor Documentation

◆ PerformanceTimer()

tools::PerformanceTimer::PerformanceTimer ( bool paused = false)

Definition at line 107 of file perf_timer.cpp.

107 : started(true), paused(paused)
108{
109 if (paused)
110 ticks = 0;
111 else
113}
uint64_t get_tick_count()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~PerformanceTimer()

tools::PerformanceTimer::~PerformanceTimer ( )

Definition at line 141 of file perf_timer.cpp.

142{
143 if (!paused)
145}
Here is the call graph for this function:

Member Function Documentation

◆ operator uint64_t()

tools::PerformanceTimer::operator uint64_t ( ) const
inline

Definition at line 57 of file perf_timer.h.

57{ return value(); }
uint64_t value() const
Here is the call graph for this function:

◆ pause()

void tools::PerformanceTimer::pause ( )

Definition at line 166 of file perf_timer.cpp.

167{
168 if (paused)
169 return;
171 paused = true;
172}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void tools::PerformanceTimer::reset ( )

Definition at line 182 of file perf_timer.cpp.

183{
184 if (paused)
185 ticks = 0;
186 else
188}
Here is the call graph for this function:

◆ resume()

void tools::PerformanceTimer::resume ( )

Definition at line 174 of file perf_timer.cpp.

175{
176 if (!paused)
177 return;
179 paused = false;
180}
Here is the call graph for this function:

◆ value()

uint64_t tools::PerformanceTimer::value ( ) const

Definition at line 190 of file perf_timer.cpp.

191{
192 uint64_t v = ticks;
193 if (!paused)
194 v = get_tick_count() - v;
195 return ticks_to_ns(v);
196}
uint64_t ticks_to_ns(uint64_t ticks)
unsigned __int64 uint64_t
Definition stdint.h:136
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ paused

bool tools::PerformanceTimer::paused
protected

Definition at line 62 of file perf_timer.h.

◆ started

bool tools::PerformanceTimer::started
protected

Definition at line 61 of file perf_timer.h.

◆ ticks

uint64_t tools::PerformanceTimer::ticks
protected

Definition at line 60 of file perf_timer.h.


The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/common/perf_timer.h
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/common/perf_timer.cpp