Agrarsense
|
#include <SimpleTimer.h>
Public Member Functions | |
SimpleTimer () | |
void | Reset () |
void | TakeTimeStamp () |
void | StopTimer (FString prefix="Code executed in ", FString suffix=" milliseconds", bool printToScreen=false) |
double | GetAverageTime () |
double | PrintAverageTime (FString prefix="Average execution time ", FString suffix=" milliseconds", bool printToScreen=false) |
void | ResetAverageTime () |
Private Attributes | |
double | startTime |
double | totalMilliseconds = 0.0 |
int | counter = 0 |
Simple milliseconds timer for quick performance or other timing testing. Should only be used for local testing.
To measure execution time of some code block:
To measure average execution time of some code block:
Definition at line 49 of file SimpleTimer.h.
|
inline |
Start SimpleTimer
Definition at line 57 of file SimpleTimer.h.
References TakeTimeStamp().
|
inline |
Get average time without printing it.
Definition at line 105 of file SimpleTimer.h.
References counter, startTime, and totalMilliseconds.
Referenced by PrintAverageTime().
|
inline |
print current average execution time.
printToScreen | should message be printed on the screen. Default false. |
prefix | Message prefix as FString. |
suffix | Message suffix as FString. |
Definition at line 123 of file SimpleTimer.h.
References GetAverageTime().
Referenced by ALidarManager::TickParallel().
|
inline |
Reset timer
Definition at line 65 of file SimpleTimer.h.
References counter, TakeTimeStamp(), and totalMilliseconds.
|
inline |
Definition at line 141 of file SimpleTimer.h.
References counter, and totalMilliseconds.
Referenced by ALidarManager::RemoveRaycastLidar().
|
inline |
Stop the timer and print result.
printToScreen | should message be printed on the screen. Default false. |
prefix | Message prefix as FString. |
suffix | Message suffix as FString. |
Definition at line 87 of file SimpleTimer.h.
References startTime.
|
inline |
Take current timestamp
Definition at line 76 of file SimpleTimer.h.
References startTime.
Referenced by Reset(), SimpleTimer(), and ALidarManager::TickParallel().
|
private |
Definition at line 151 of file SimpleTimer.h.
Referenced by GetAverageTime(), Reset(), and ResetAverageTime().
|
private |
Definition at line 149 of file SimpleTimer.h.
Referenced by GetAverageTime(), StopTimer(), and TakeTimeStamp().
|
private |
Definition at line 150 of file SimpleTimer.h.
Referenced by GetAverageTime(), Reset(), and ResetAverageTime().