![]() |
KiCad PCB EDA Suite
|
A small class to help profiling. More...
#include <profile.h>
Public Member Functions | |
PROF_COUNTER (const std::string &aName, bool aAutostart=true) | |
Create a PROF_COUNTER for measuring an elapsed time in milliseconds. More... | |
PROF_COUNTER () | |
Create a PROF_COUNTER for measuring an elapsed time in milliseconds. More... | |
void | Start () |
Start or restart the counter. More... | |
void | Stop () |
Save the time when this function was called, and set the counter stane to stop. More... | |
void | Show (std::ostream &aStream=std::cerr) |
Print the elapsed time (in a suitable unit) to a stream. More... | |
template<typename DURATION > | |
DURATION | SinceStart (bool aSinceLast=false) |
double | msecs (bool aSinceLast=false) |
Private Types | |
using | CLOCK = std::chrono::high_resolution_clock |
using | TIME_POINT = std::chrono::time_point< CLOCK > |
Private Attributes | |
std::string | m_name |
bool | m_running |
TIME_POINT | m_starttime |
TIME_POINT | m_lasttime |
TIME_POINT | m_stoptime |
A small class to help profiling.
It allows the calculation of the elapsed time (in milliseconds) between its creation (or the last call to Start() ) and the last call to Stop()
|
private |
|
private |
|
inline |
Create a PROF_COUNTER for measuring an elapsed time in milliseconds.
aName | a string that will be printed in message. |
aAutostart | true (default) to immediately start the timer |
Definition at line 54 of file profile.h.
References Start().
|
inline |
Create a PROF_COUNTER for measuring an elapsed time in milliseconds.
The counter is started and the string to print in message is left empty.
Definition at line 66 of file profile.h.
References Start().
|
inline |
aSinceLast | only get the time since the last time the time was read. |
Definition at line 146 of file profile.h.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), eserie::combine4(), KIGFX::CACHED_CONTAINER_GPU::defragmentResize(), KIGFX::CACHED_CONTAINER_RAM::defragmentResize(), KIGFX::CACHED_CONTAINER_GPU::defragmentResizeMemcpy(), EDA_DRAW_PANEL_GAL::DoRePaint(), KIGFX::GPU_CACHED_MANAGER::EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), KIGFX::OPENGL_GAL::endDrawing(), QA_SEXPR_PARSER::Parse(), CONNECTION_GRAPH::Recalculate(), SCH_EDIT_FRAME::RecalculateConnections(), and KIGFX::VIEW::Redraw().
|
inline |
Print the elapsed time (in a suitable unit) to a stream.
The unit is automatically chosen from ns, us, ms and s, depending on the size of the current count.
the | stream to print to. |
Definition at line 102 of file profile.h.
References m_name.
Referenced by RN_NET::compute(), SCH_EDIT_FRAME::OpenProjectFiles(), polygon_triangulation_main(), CONNECTION_GRAPH::Recalculate(), CN_CONNECTIVITY_ALGO::searchConnections(), and CONNECTIVITY_DATA::updateRatsnest().
|
inline |
Definition at line 132 of file profile.h.
References m_lasttime, m_running, m_starttime, and m_stoptime.
Referenced by parse(), and SCOPED_PROF_COUNTER< DURATION >::~SCOPED_PROF_COUNTER().
|
inline |
Start or restart the counter.
Definition at line 74 of file profile.h.
References m_lasttime, m_running, and m_starttime.
Referenced by PROF_COUNTER().
|
inline |
Save the time when this function was called, and set the counter stane to stop.
Definition at line 85 of file profile.h.
References m_running, and m_stoptime.
Referenced by KIGFX::OPENGL_GAL::beginDrawing(), KIGFX::CACHED_CONTAINER_GPU::defragmentResize(), KIGFX::CACHED_CONTAINER_RAM::defragmentResize(), KIGFX::CACHED_CONTAINER_GPU::defragmentResizeMemcpy(), EDA_DRAW_PANEL_GAL::DoRePaint(), KIGFX::GPU_CACHED_MANAGER::EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), KIGFX::OPENGL_GAL::endDrawing(), CONNECTION_GRAPH::Recalculate(), SCH_EDIT_FRAME::RecalculateConnections(), and KIGFX::VIEW::Redraw().
|
private |
Definition at line 159 of file profile.h.
Referenced by SinceStart(), and Start().
|
private |
|
private |
Definition at line 154 of file profile.h.
Referenced by SinceStart(), Start(), and Stop().
|
private |
Definition at line 159 of file profile.h.
Referenced by SinceStart(), and Start().
|
private |
Definition at line 159 of file profile.h.
Referenced by SinceStart(), and Stop().