SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
Singleton timing class for average measurement of different timing blocks in loops. More...
#include <AverageTiming.h>
Inherits std::map< std::string, AverageTimingBlock * >.
Public Member Functions | |
AverageTiming () | |
~AverageTiming () | |
Static Public Member Functions | |
static void | start (const std::string &name) |
start timer for a new or existing block More... | |
static void | stop (const std::string &name) |
stop timer for a running block with name More... | |
static float | getTime (const std::string &name) |
get time for block with name More... | |
static float | getTime (const std::vector< std::string > &names) |
get time for multiple blocks with given names More... | |
static void | getTimingMessage (char *m) |
get timings formatted via string More... | |
static AverageTiming & | instance () |
singleton More... | |
Private Member Functions | |
void | doStart (const std::string &name) |
do start timer for a new or existing block More... | |
void | doStop (const std::string &name) |
do stop timer for a running block with name More... | |
float | doGetTime (const std::string &name) |
do get time for block with name More... | |
float | doGetTime (const std::vector< std::string > &names) const |
do get time for multiple blocks with given names More... | |
void | doGetTimingMessage (char *m) |
do get timings formatted via string More... | |
Private Attributes | |
int | _averageNumValues = 200 |
int | _currentPosV = 0 |
int | _currentPosH = 0 |
Singleton timing class for average measurement of different timing blocks in loops.
Call start("name") to define a new timing block and start timing or start timing of an existing block. Call stop("name") to finish measurement for this block. Define a hierarchy by posV and posH which is used in ui to arrange the measurements. The first found content with posV==0 is used as reference measurement for the percental value.
Definition at line 54 of file AverageTiming.h.
Utils::AverageTiming::AverageTiming | ( | ) |
Definition at line 20 of file AverageTiming.cpp.
Utils::AverageTiming::~AverageTiming | ( | ) |
Definition at line 24 of file AverageTiming.cpp.
|
private |
do get time for block with name
get time for block with name
Definition at line 102 of file AverageTiming.cpp.
|
private |
do get time for multiple blocks with given names
get time for multiple blocks with given names
Definition at line 116 of file AverageTiming.cpp.
|
private |
do get timings formatted via string
Definition at line 128 of file AverageTiming.cpp.
|
private |
do start timer for a new or existing block
start timer for a new or existing block
Definition at line 64 of file AverageTiming.cpp.
|
private |
do stop timer for a running block with name
stop timer for a running block with name
Definition at line 84 of file AverageTiming.cpp.
|
static |
get time for block with name
Definition at line 46 of file AverageTiming.cpp.
|
static |
get time for multiple blocks with given names
Definition at line 52 of file AverageTiming.cpp.
|
static |
get timings formatted via string
Definition at line 58 of file AverageTiming.cpp.
|
inlinestatic |
|
static |
start timer for a new or existing block
Definition at line 34 of file AverageTiming.cpp.
|
static |
stop timer for a running block with name
Definition at line 40 of file AverageTiming.cpp.
|
private |
Definition at line 91 of file AverageTiming.h.
|
private |
Definition at line 93 of file AverageTiming.h.
|
private |
Definition at line 92 of file AverageTiming.h.