A timer that can be used to measure the execution time of a method.
More...
|
| TimerRun | Run (Action methodToTime, int repetitions=0, int runAtLeastMs=200, Action setupMethod=null) |
| | Runs a performance test for the methodToTime by measuring the execution time. More...
|
| |
| RepeatedTimerRun | RunRepeatedly (Action methodToTime, int runs=3, int repetitions=0, int runAtLeastMs=200, Action setupMethod=null) |
| | Runs a performance test for the methodToTime exactly runs times. More...
|
| |
A timer that can be used to measure the execution time of a method.
- Since
- 0.3.0
◆ Run()
| TimerRun Joutsen.System.Diagnostics.MethodTimer.Run |
( |
Action |
methodToTime, |
|
|
int |
repetitions = 0, |
|
|
int |
runAtLeastMs = 200, |
|
|
Action |
setupMethod = null |
|
) |
| |
Runs a performance test for the methodToTime by measuring the execution time.
- Parameters
-
| methodToTime | the method to test. If it requires parameters it can be wrapped in a parameterless action |
| repetitions | the number of repetitions for this test run. Default is zero (0). When set to zero the test run will use runAtLeastMs instead to determine the number of repetitions. |
| runAtLeastMs | the time in ms that should elapse before the test is stopped. The number of repetitions will be succeededly increased by powers of one until runAtLeastMs is exceeded. |
| setupMethod | a method that is executed before each repetition. This can be used prepare or cleanup objects between repetitions. |
- Returns
- the result of the test run
◆ RunRepeatedly()
| RepeatedTimerRun Joutsen.System.Diagnostics.MethodTimer.RunRepeatedly |
( |
Action |
methodToTime, |
|
|
int |
runs = 3, |
|
|
int |
repetitions = 0, |
|
|
int |
runAtLeastMs = 200, |
|
|
Action |
setupMethod = null |
|
) |
| |
Runs a performance test for the methodToTime exactly runs times.
- Parameters
-
| methodToTime | the method to test. If it requires parameters it can be wrapped in a parameterless action. |
| runs | the number of times to repeat the entire test. Default is 3. |
| repetitions | the number of repetitions for each test run. Default is zero (0). When set to zero the test run will use runAtLeastMs instead to determine the number of repetitions. |
| runAtLeastMs | the time in ms that should elapse before the one test is stopped. The number of repetitions will be succeededly increased by powers of one until runAtLeastMs is exceeded. |
| setupMethod | a method that is executed before each repetition. This can be used prepare or cleanup objects between repetitions. |
- Returns
- the result of the test runs