The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
TimeSpan::CompareTo Method
.NET Framework (current version)
Compares this instance to a specified object or TimeSpan object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object or TimeSpan object.
Assembly: mscorlib (in mscorlib.dll)
| Name | Description | |
|---|---|---|
![]() | CompareTo(Object^) | 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. |
![]() | CompareTo(TimeSpan) |
The two overloads of the CompareTo method return a signed number that indicates the relative value of this instance and the value argument, as shown in the following table.
Value | Description |
|---|---|
Less than zero | This instance is shorter than value. |
Zero | This instance is the same as value. |
Greater than zero | This instance is longer than value. |
Show:
