Table of Contents

Class ArrayParam<T>

Namespace
BenchmarkDotNet.Code
Assembly
BenchmarkDotNet.dll
public class ArrayParam<T> : IParam

Type Parameters

T
Inheritance
ArrayParam<T>
Implements

Properties

DisplayText

used to display the value (e.g. in summary in Params column)

public string DisplayText { get; }

Property Value

string

Value

value of the parameter object for benchmark used internally (e.g. by the InProcessToolchain)

public object Value { get; }

Property Value

object

Methods

ForComplexTypes(T[], Func<T, string>)

for types where calling .ToString() will be NOT enough to re-create them in auto-generated source code file

public static ArrayParam<T> ForComplexTypes(T[] array, Func<T, string> toSourceCode)

Parameters

array T[]

the array

toSourceCode Func<T, string>

method which transforms an item of type T to it's C# representation example: point => $"new Point2d({point.X}, {point.Y})"

Returns

ArrayParam<T>

ForPrimitives(T[])

for types where calling .ToString() will be enough to re-create them in auto-generated source code file (integers, strings and other primitives)

public static ArrayParam<T> ForPrimitives(T[] array)

Parameters

array T[]

Returns

ArrayParam<T>

ToSourceCode()

this source code is used to create parameter for benchmark in C# source code file example: $"new Point2D({Value.X}, {Value.Y})"

public string ToSourceCode()

Returns

string