subtract method

Duration subtract(
  1. Duration duration, [
  2. Duration? secondDuration
])

subtract duration

Implementation

Duration subtract(Duration duration, [Duration? secondDuration]) {
  int s = inMicroseconds -
      duration.inMicroseconds -
      (secondDuration?.inMicroseconds ?? 0);
  if (s < 0) s = 0;
  return Duration(microseconds: s);
}