DurationFormattedEnglish constructor

DurationFormattedEnglish(
  1. int microseconds
)

Implementation

DurationFormattedEnglish(int microseconds) {
  const MS = 1000,
      S = 1000 * MS,
      M = 60 * S,
      H = 60 * M,
      D = 24 * H,
      W = 7 * D;
  late final int tms, ts, tm, th, td, tw;
  w = microseconds ~/ W;
  tw = microseconds - W * w;
  d = tw ~/ D;
  td = tw - D * d;
  h = td ~/ H;
  th = td - H * h;
  m = th ~/ M;
  tm = th - M * m;
  s = tm ~/ S;
  ts = tm - s * S;
  ms = ts ~/ MS;
  tms = ts - ms * MS;
  us = tms;
}