getMillisecondsAsUnit function
Implementation
double? getMillisecondsAsUnit(int? ms, Object? unit, [double? def]) {
if (ms == null) return def;
if (ms == 0) return 0;
if (unit == null) return def;
var unitParsed = parseUnit(unit);
if (unitParsed == null) return def;
var unitMs = _getUnitMilliseconds(unitParsed)!;
var res = ms / unitMs;
return res;
}