Table of Contents

Class TimeSpanUtils

Namespace
NanoByte.Common
Assembly
NanoByte.Common.dll

Helper methods for System.TimeSpan.

public static class TimeSpanUtils
Inheritance
object
TimeSpanUtils

Methods

Divide(TimeSpan, double)

Divides the timespan by a factor.

[Pure]
public static TimeSpan Divide(this TimeSpan timeSpan, double factor)

Parameters

timeSpan TimeSpan
factor double

Returns

TimeSpan

Divide(TimeSpan, TimeSpan)

Divides two timespans, returning the quotient.

[Pure]
public static double Divide(this TimeSpan timeSpan, TimeSpan other)

Parameters

timeSpan TimeSpan
other TimeSpan

Returns

double

FromSecondsAccurate(double)

Like System.TimeSpan.FromSeconds(double), but with higher-than-millisecond accuracy.

[Pure]
public static TimeSpan FromSecondsAccurate(double seconds)

Parameters

seconds double

Returns

TimeSpan

Multiply(TimeSpan, double)

Multiplies the timespan by a factor.

[Pure]
public static TimeSpan Multiply(this TimeSpan timeSpan, double factor)

Parameters

timeSpan TimeSpan
factor double

Returns

TimeSpan