Struct Measurement
- Namespace
- BenchmarkDotNet.Reports
- Assembly
- BenchmarkDotNet.dll
The basic captured statistics for a benchmark
public struct Measurement : IComparable<Measurement>
- Implements
- Inherited Members
- Extension Methods
Constructors
Measurement(int, IterationMode, IterationStage, int, long, double)
Creates an instance of Measurement struct.
public Measurement(int launchIndex, IterationMode iterationMode, IterationStage iterationStage, int iterationIndex, long operations, double nanoseconds)
Parameters
launchIndexintiterationModeIterationModeiterationStageIterationStageiterationIndexintoperationslongThe number of operations performed.
nanosecondsdoubleThe total number of nanoseconds it took to perform all operations.
Properties
IterationIndex
public readonly int IterationIndex { get; }
Property Value
IterationMode
public readonly IterationMode IterationMode { get; }
Property Value
IterationStage
public readonly IterationStage IterationStage { get; }
Property Value
LaunchIndex
public readonly int LaunchIndex { get; }
Property Value
Nanoseconds
Gets the total number of nanoseconds it took to perform all operations.
public readonly double Nanoseconds { get; }
Property Value
Operations
Gets the number of operations performed.
public readonly long Operations { get; }
Property Value
Methods
CompareTo(Measurement)
public int CompareTo(Measurement other)
Parameters
otherMeasurement
Returns
GetAverageTime()
Gets the average duration of one operation.
public TimeInterval GetAverageTime()
Returns
- TimeInterval
Parse(string, int)
Parses the benchmark statistics from the plain text line.
E.g. given the input line:
WorkloadTarget 1: 10 op, 1005842518 ns
Will extract the number of Operations performed and the total number of Nanoseconds it took to perform them.
public static Measurement Parse(string line, int processIndex)
Parameters
Returns
- Measurement
An instance of Measurement if parsed successfully.
Nullin case of any trouble.
ToString()
public override string ToString()