-
Notifications
You must be signed in to change notification settings - Fork 3
Loop
Allows an operation to be called multiple times.
When profiling an operation, the stopwatch will start and stop each time it's called. Each start and stop will introduce a bit of rounding error and with frequently called operations, those rounding errors can build up and make it hard to judge if one way of patching is faster than another approach.
If you loop and that way use the same XPATH search multiple times within the same root operation, the clock will continue to run, which will reduce the impact of the rounding errors.
In other words Loop is useful for measuring performance of operations, but has no known use in released patches.
Tag | Mandatory | Type | Default | Description |
---|---|---|---|---|
patchName | no | string | Name of patch for log/profiling | |
operation | yes | PatchOperation | The operation to loop | |
times | no | int | 1 | Number of times to loop |
reset | no | bool | true | Reset ModCheck cache for each run |
Reset only applies to ModCheck operations. Use Sequence instead of PatchOperationSequence or the cache reset call will fail.
Will only fail if operation is empty.
<li Class="ModCheck.Loop">
<patchName>Insert time check</patchName>
<times>1000</times>
<reset>false</false>
<!-- with no ModCheck operations nested inside operation, skip the reset call -->
<operation class="PatchOperationAdd">
<!-- some patching code -->
</operation>
</li>