TimeSpan.IComparable.CompareTo(Object) Method

Definition

Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object.

 virtual int System.IComparable.CompareTo(System::Object ^ value) = IComparable::CompareTo;
int IComparable.CompareTo (object value);
Function CompareTo (value As Object) As Integer Implements IComparable.CompareTo

Parameters

value
Object

Returns

      One of the following values:
      <table><thead><tr><th>Value</th><th>Description</th></tr></thead><tbody><tr><td>-1</td><td>This instance is shorter than <code data-dev-comment-type="paramref">value</code>.</td></tr><tr><td>0</td><td>This instance is equal to <code data-dev-comment-type="paramref">value</code>.</td></tr><tr><td>1</td><td>This instance is longer than <code data-dev-comment-type="paramref">value</code>.

-or-

value is null.

Implements

Remarks

This member is an explicit interface member implementation. It can be used only when the TimeSpan instance is cast to an IComparable interface.

Applies to