Table of Contents

Class StopwatchTimestamp

Namespace
LfrlAnvil.Diagnostics
Assembly
LfrlAnvil.Core.dll

Contains conversions between Stopwatch ticks and TimeSpan ticks.

public static class StopwatchTimestamp
Inheritance
StopwatchTimestamp
Inherited Members

Fields

TicksPerStopwatchTick

Ratio of how many TimeSpan ticks there are in a single Stopwatch tick.

public static readonly double TicksPerStopwatchTick

Field Value

double

Methods

GetStopwatchTicks(long)

Converts time measures in TimeSpan ticks to Stopwatch ticks.

[Pure]
public static long GetStopwatchTicks(long ticks)

Parameters

ticks long

Time elapsed in TimeSpan ticks.

Returns

long

Time elapsed in Stopwatch ticks.

GetStopwatchTicks(TimeSpan)

Converts time measures in TimeSpan to Stopwatch ticks.

[Pure]
public static long GetStopwatchTicks(TimeSpan timeSpan)

Parameters

timeSpan TimeSpan

Time elapsed.

Returns

long

Time elapsed in Stopwatch ticks.

GetTicks(long, long)

Converts time measured in Stopwatch ticks to TimeSpan ticks.

[Pure]
public static long GetTicks(long start, long end)

Parameters

start long

Start of Stopwatch time measurement.

end long

End of Stopwatch time measurement.

Returns

long

Time elapsed in TimeSpan ticks.

GetTimeSpan(long, long)

Converts time measured in Stopwatch ticks to TimeSpan.

[Pure]
public static TimeSpan GetTimeSpan(long start, long end)

Parameters

start long

Start of Stopwatch time measurement.

end long

End of Stopwatch time measurement.

Returns

TimeSpan

Time elapsed in TimeSpan.