compareIntRepresentationTime function

TimeComparisonResult compareIntRepresentationTime(
  1. int timeA,
  2. int timeB
)

Compares two time values and returns the result.

If timeA is considered before timeB, the result will be TimeComparisonResult.before, etc.

Implementation

TimeComparisonResult compareIntRepresentationTime(int timeA, int timeB) {
  if (timeA < timeB) {
    return TimeComparisonResult.before;
  } else if (timeA == timeB) {
    return TimeComparisonResult.same;
  } else {
    // timeA > timeB
    return TimeComparisonResult.after;
  }
}