Provides a static Time method which times running the provided action the specified number of times.
More...
|
static void | PrintTime (string label, Action toRun, int iterations) |
| Times the provided action, run the provided number of iterations, and then prints out the run time to stdout.
|
static async Task | PrintTimeAsync (string label, Func< Task > toRun, int iterations) |
| Times the provided action, run the provided number of iterations, and then prints out the run time to stdout.
|
static TimeSpan | Time (Action action) |
| Time a single iteration of the provided action.
|
static TimeSpan | Time (Action action, int iterations) |
| Time an action, run the specified number of times, and return the total time taken.
|
static async Task< TimeSpan > | TimeAsync (Func< Task > action) |
| Time a single iteration of the provided async action.
|
static async Task< TimeSpan > | TimeAsync (Func< Task > action, int iterations) |
| Time an async action, run the specified number of times, and return the total time taken.
|
Provides a static Time method which times running the provided action the specified number of times.
◆ PrintTime()
void PeanutButter.Utils.Benchmark.PrintTime |
( |
string | label, |
|
|
Action | toRun, |
|
|
int | iterations ) |
|
static |
Times the provided action, run the provided number of iterations, and then prints out the run time to stdout.
- Parameters
-
◆ PrintTimeAsync()
async Task PeanutButter.Utils.Benchmark.PrintTimeAsync |
( |
string | label, |
|
|
Func< Task > | toRun, |
|
|
int | iterations ) |
|
static |
Times the provided action, run the provided number of iterations, and then prints out the run time to stdout.
- Parameters
-
◆ Time() [1/2]
TimeSpan PeanutButter.Utils.Benchmark.Time |
( |
Action | action | ) |
|
|
static |
Time a single iteration of the provided action.
- Parameters
-
- Returns
◆ Time() [2/2]
TimeSpan PeanutButter.Utils.Benchmark.Time |
( |
Action | action, |
|
|
int | iterations ) |
|
static |
Time an action, run the specified number of times, and return the total time taken.
- Parameters
-
- Returns
◆ TimeAsync() [1/2]
async Task< TimeSpan > PeanutButter.Utils.Benchmark.TimeAsync |
( |
Func< Task > | action | ) |
|
|
static |
Time a single iteration of the provided async action.
- Parameters
-
- Returns
◆ TimeAsync() [2/2]
async Task< TimeSpan > PeanutButter.Utils.Benchmark.TimeAsync |
( |
Func< Task > | action, |
|
|
int | iterations ) |
|
static |
Time an async action, run the specified number of times, and return the total time taken.
- Parameters
-
- Returns
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.Utils/Benchmark.cs