compareTo method

int compareTo(
  1. Time other
)

Compares two Time values in UTC, returning:

  • negative if this time is earlier than other
  • positive if this time is later than other
  • zero if the times are equal

Both times are compared in UTC, ensuring consistent results across timezones.

Implementation

int compareTo(Time other) => totalSeconds - other.totalSeconds;