Appearance
ExecutionTime
Inherits: LibTSMModule
Functions
CheckElapsed
lua
function Util.ExecutionTime.CheckElapsed(elapsedTime, labelFormatString, ...)Checks the elapsed time and warns if it's too long.
Parameters:
| Name | Type | Description |
|---|---|---|
elapsedTime | number | The elapsed time |
labelFormatString | string | The label format string to use for logging any warnings |
... | any | Additional arguments for the label format string |
WithMeasurement
lua
function Util.ExecutionTime.WithMeasurement(labelFormatString, ...)
-> function, table, anyReturns an iterator which executes exactly once and measures the time taken within the loop body, warning if it's too long.
Parameters:
| Name | Type | Description |
|---|---|---|
labelFormatString | string | The label format string to use for logging any warnings |
... | any | Additional arguments for the label format string |
Returns:
| Type | Description |
|---|---|
function | |
table | |
any |
WithMeasurementAndRaisedLogStackLevel
lua
function Util.ExecutionTime.WithMeasurementAndRaisedLogStackLevel(raiseStackLevel, labelFormatString, ...)
-> function, table, anyReturns an iterator which executes exactly once and measures the time taken within the loop body, warning if it's too long.
Parameters:
| Name | Type | Description |
|---|---|---|
raiseStackLevel | number | The amount to raise the stack level before logging |
labelFormatString | string | The label format string to use for logging any warnings |
... | any | Additional arguments for the label format string |
Returns:
| Type | Description |
|---|---|
function | |
table | |
any |