Mono Class Library: System.TimeSpan Overview | Members

System.TimeSpan.CompareTo Method

Returns the sort order of the current instance compared to the specified TimeSpan.

public int CompareTo (TimeSpan value)

Parameters

value
The TimeSpan to compare to the current instance.

Returns

The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to value. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

ValueCondition
Any negative numberCurrent instance < value.
ZeroCurrent instance == value.
Any positive numberCurrent instance > value.

Remarks

Note: This method is implemented to support the IComparable<TimeSpan> interface.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0