toReadableTime property

String get toReadableTime

Implementation

String get toReadableTime {
  if (this < 0) {
    return "-1 ms";
  }
  if (this <= 1000) {
    return "$this ms";
  }
  if (this <= 60000) {
    return "${(this / 1000).formattedString} s";
  }

  final Duration duration = Duration(milliseconds: this);

  return "${duration.inMinutes} min ${duration.inSeconds.remainder(60)} s "
      "${duration.inMilliseconds.remainder(1000)} ms";
}