Duration.CompareTo(Duration) Method

Definition

Compares this duration to the specified Duration.

[Android.Runtime.Register("compareTo", "(Ljava/time/Duration;)I", "", ApiSince=26)]
public int CompareTo(Java.Time.Duration? otherDuration);
[<Android.Runtime.Register("compareTo", "(Ljava/time/Duration;)I", "", ApiSince=26)>]
member this.CompareTo : Java.Time.Duration -> int

Parameters

otherDuration
Duration

the other duration to compare to, not null

Returns

the comparator value, that is less than zero if this duration is less than otherDuration, zero if they are equal, greater than zero if this duration is greater than otherDuration

Attributes

Remarks

Compares this duration to the specified Duration. The comparison is based on the total length of the durations. It is "consistent with equals", as defined by Comparable.

Java reference for java.time.Duration.compareTo.

Applies to