A simple benchmarking tool.

Syntax

SRP_Stopwatch(Service, Param)

Parameters

Title FieldDescription
ServiceThe stopwatch service to execute.
ParamThe stopwatch service parameter, which depends upon the service.

Remarks

SRP_Stopwatch simplifies benchmarking by tracking multiple benchmarks and displaying them for you at the end. Here's a quick tutorial on how to use it.

Resetting

At the beginning of your benchmark code, you need to reset the stopwatch. This clears all benchmarks that might exist from previous runs.

SRP_Stopwatch("Reset")

Benchmarking

Surround blocks of code with a benchmark, identifying the benchmark by name.

 

// Insert the text at random field, value, and subvalue positions
SRP_Stopwatch("Start", "OIInsert")
TestOI = ""
For i = 1 to Iterations
   TestOI = Insert(TestOI, Rnd(MaxPos), Rnd(MaxPos), Rnd(MaxPos), InsertText)
Next i
SRP_Stopwatch("Stop", "OIInsert")
You can do this more than once using a different name for each benchmark.
// Insert the text at random field, value, and subvalue positions using SRP Fast Array
SRP_Stopwatch("Start", "SRPInsert")
Handle = SRP_FastArray_Create()
For i = 1 to Iterations
   SRP_FastArray_Insert(Handle, Rnd(MaxPos), Rnd(MaxPos), Rnd(MaxPos), InsertText)
Next i
TestSRP = SRP_FastArray_GetVariable(Handle)
SRP_Stopwatch("Stop", "SRPInsert")

 

Results

At the end of your benchmarking, you can quickly display the results, which will be nicely formatted.

SRP_Stopwatch("ShowAll")

You can show individual benchmarking results as well.

SRP_Stopwatch("Show", "SRPInsert")

Or, you can just get the results in a variable and do whatever you want with them.

OneResult = SRP_Stopwatch("GetBenchmark", "SRPInsert")
AllResults = SRP_Stopwatch("GetAll")