diffWithPrecision method

int diffWithPrecision(
  1. Hora other, {
  2. required TimePrecision precision,
})

Computes the difference with precision-aware truncation.

Implementation

int diffWithPrecision(Hora other, {required TimePrecision precision}) =>
    truncateTo(precision)
        .diff(
          other.truncateTo(precision),
          precision.toUnit,
        )
        .toInt();