formatTime static method
Format time in milliseconds
Implementation
static String formatTime(int timeInMillis) {
if (timeInMillis < 0) {
return '-1 ms';
}
if (timeInMillis <= _secondAsMillisecond) {
return '$timeInMillis ms';
}
if (timeInMillis <= _minuteAsMillisecond) {
return '${_formatDouble(timeInMillis / _secondAsMillisecond)} s';
}
final duration = Duration(milliseconds: timeInMillis);
return '${duration.inMinutes} min ${duration.inSeconds.remainder(60)} s '
'${duration.inMilliseconds.remainder(1000)} ms';
}