AFTimeSpan.CompareTo Method (AFTimeSpan)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Compares this instance with a specified AFTimeSpan.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public int CompareTo( AFTimeSpan obj )
Public Function CompareTo ( obj As AFTimeSpan ) As Integer Dim instance As AFTimeSpan Dim obj As AFTimeSpan Dim returnValue As Integer returnValue = instance.CompareTo(obj)
public: virtual int CompareTo( AFTimeSpan obj ) sealed
abstract CompareTo : obj : AFTimeSpan -> int override CompareTo : obj : AFTimeSpan -> int
Parameters
- obj
- Type: OSIsoft.AF.TimeAFTimeSpan
The object to be compared.
Return Value
Type: Int32A 32-bit signed integer that indicates the relative order of the comparands. The return value has these meanings:
| Value | Meaning |
|---|---|
| Less than zero | This instance is less than obj. |
| Zero | This instance is equal to obj. |
| Greater than zero | This instance is greater than obj. |
Implements
IComparableTCompareTo(T)
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | The obj parameter is not the same type as this instance. |
Remarks
By definition, any object compares greater than
and two null references compare equal to each other.
Version Information
AFSDK
See Also
Reference
List<T>.Sort()