Share via


Compare Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Compares two TimeSpan values and returns an integer that indicates whether the first value is shorter than, equal to, or longer than the second value.

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

Syntax

'Declaration
Public Shared Function Compare ( _
    t1 As TimeSpan, _
    t2 As TimeSpan _
) As Integer
public static int Compare(
    TimeSpan t1,
    TimeSpan t2
)
public:
static int Compare(
    TimeSpan t1, 
    TimeSpan t2
)
static member Compare : 
        t1:TimeSpan * 
        t2:TimeSpan -> int 
public static function Compare(
    t1 : TimeSpan, 
    t2 : TimeSpan
) : int

Parameters

Return Value

Type: System. . :: . .Int32
One of the following values.

Value

Description

-1

t1 is shorter than t2.

0

t1 is equal to t2.

1

t1 is longer than t2.

.NET Framework Security

See Also

Reference

TimeSpan Structure

System Namespace