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
launchIndex
intiterationMode
IterationModeiterationStage
IterationStageiterationIndex
intoperations
longThe number of operations performed.
nanoseconds
doubleThe total number of nanoseconds it took to perform all operations.
Properties
IterationIndex
public readonly int IterationIndex { get; }
Property Value
- int
- The basic captured statistics for a benchmark
IterationMode
public readonly IterationMode IterationMode { get; }
Property Value
- IterationMode
- The basic captured statistics for a benchmark
IterationStage
public readonly IterationStage IterationStage { get; }
Property Value
- IterationStage
- The basic captured statistics for a benchmark
LaunchIndex
public readonly int LaunchIndex { get; }
Property Value
- int
- The basic captured statistics for a benchmark
Nanoseconds
Gets the total number of nanoseconds it took to perform all operations.
public readonly double Nanoseconds { get; }
Property Value
- double
- The basic captured statistics for a benchmark
Operations
Gets the number of operations performed.
public readonly long Operations { get; }
Property Value
- long
- The basic captured statistics for a benchmark
Methods
CompareTo(Measurement)
public int CompareTo(Measurement other)
Parameters
other
Measurement- The basic captured statistics for a benchmark
Returns
- int
- The basic captured statistics for a benchmark
GetAverageTime()
Gets the average duration of one operation.
public TimeInterval GetAverageTime()
Returns
- TimeInterval
- The basic captured statistics for a benchmark
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.
Null
in case of any trouble.
ToString()
public override string ToString()
Returns
- string
- The basic captured statistics for a benchmark