Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TimeMeasurementHelper.c File Reference

Go to the source code of this file.

Classes

class  SCR_TimeMeasurementHelper_Info

Functions

void BeginMeasure (string name)
void EndMeasure (string name)
float GetMeasure (string name)
void PrintAllMeasures ()
 Print all measurements to the console, ended or not.
void Reset ()
 Delete all stored measurements, ended or not.
void SCR_TimeMeasurementHelper ()

Function Documentation

◆ BeginMeasure()

void BeginMeasure ( string name)

This class can add multiple measurements - useful to measure specific parts of a loop

Debug.BeginTimeMeasure();
foreach (SCR_Object obj : m_aObjects)
{
benchmark.BeginMeasure("opAandC");
obj.OperationA();
benchmark.EndMeasure("opAandC"); // names are case-sensitive
benchmark.BeginMeasure("opB");
obj.OperationB();
benchmark.EndMeasure("opB");
benchmark.BeginMeasure("opAandC");
obj.OperationC();
benchmark.EndMeasure("opAandC"); // time will be -added- to this measurement
}
Debug.EndTimeMeasure("Operation A, B and C total benchmark");
Print("Operation A && C: " + benchmark.GetMeasure("opAandC") + " ms", LogLevel.NORMAL);
Print("Operation B only: " + benchmark.GetMeasure("opB") + " ms", LogLevel.NORMAL);
// or
benchmark.PrintAllMeasures();
\code
{
---------------------------------------------------------------------------------------------—

Definition at line 32 of file SCR_TimeMeasurementHelper.c.

◆ EndMeasure()

void EndMeasure ( string name)

End a started measurement If the measurement has not been started, a warning is printed

Parameters
[in]namecase-sensitive, must be identical to BeginMeasure's provided name

Definition at line 48 of file SCR_TimeMeasurementHelper.c.

◆ GetMeasure()

float GetMeasure ( string name)

Get a measurement by name If the measurement has never been ended, its value is 0 If the measurement has not been started, a warning is printed and -1 is returned

Parameters
[in]namethe case-sensitive measurement name
Returns
measured time in ms, 0 if the measurement has not been ended, -1 if the measurement does not exist

Definition at line 66 of file SCR_TimeMeasurementHelper.c.

◆ PrintAllMeasures()

void PrintAllMeasures ( )

Print all measurements to the console, ended or not.

Definition at line 80 of file SCR_TimeMeasurementHelper.c.

◆ SCR_TimeMeasurementHelper()

void SCR_TimeMeasurementHelper ( )

Definition at line 97 of file SCR_TimeMeasurementHelper.c.