Share via


TimeSpan.Compare Method

Compares two specified TimeSpan objects (time periods) with one another to determine their relative value.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static int Compare (
         TimeSpan t1,
         TimeSpan t2
)

Parameters

  • t1
    A TimeSpan object that specifies a period of time.
  • t2
    A TimeSpan object that specifies a period of time.

Return Value

An integer that represents the relative value of the two TimeSpan objects specified by the t1 and t2 parameters.

Return value Meaning
Less than 0 (zero) The value of t1 is less than the value of t2.
0 (zero) The value of t1 is equal to the value of t2.
Greater than 0 (zero) The value of t1 is greater than the value of t2.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

TimeSpan Structure
TimeSpan Members
System Namespace