public static T Zero<T>(Func<T> func, int warmupIterations = 1)
Asserts that func allocates zero managed bytes on the current thread after running warmupIterations warmup calls, and returns its result.
Type Parameters
T- The return type of the delegate.
Parameters
func- The delegate to measure.
warmupIterations- Number of warmup invocations to JIT and prime caches before measuring.
Returns: The value returned by the measured invocation.
public static void AtMost(Action action, long maxBytes, int warmupIterations = 1)
Asserts that action allocates at most maxBytes managed bytes on the current thread after running warmupIterations warmup calls.
Parameters
action- The delegate to measure.
maxBytes- The maximum permitted allocation in bytes.
warmupIterations- Number of warmup invocations to JIT and prime caches before measuring.