Compares the TimeSpan value of the current instance with the specified object.
[Visual Basic] Overridable Public Function CompareTo( _ ByVal value As Object _ ) As Integer [C#] public virtual int CompareTo( object value ); [C++] public: virtual int CompareTo( Object* value ); [JScript] public function CompareTo( value : Object ) : int;
Value | Condition |
---|---|
A negative integer | If this instance is less than object. |
A zero | If the current instance and object have the same value. |
A positive integer | If the current instance is greater than object. |
A positive integer | If object is a null reference (in Visual Basic Nothing). This is a special case. |
Exception Type | Condition |
---|---|
ArgumentException | If the object isn't a TimeSpan. |
The value parameter must be either a TimeSpan type or a null object reference.
In the comparison of two TimeSpan values, the number of ticks is used to determine the ordering. A new instance, regardless of its value, is considered to be greater than a null reference.
TimeSpan Structure | TimeSpan Members | System Namespace | Int64 | Object | Ticks