Benchmark.Compare

Static Method in Benchmark

Declaration

public static double Compare(Action foo, Action bar, int iterations, bool log = true)

Description

Compares the execution time between two functions with a given amount of iterations.

Parameters

fooThe first function to be executed.
barThe second function to be executed.
iterationsThe amount of times each function is executed.
logLogs the result to the console.

Returns

doubleThe difference in execution time of the two functions in milliseconds.