get timespan()

in glean/src/core/metrics/types/timespan.ts [42:59]


  get timespan(): number {
    switch (this.inner.timeUnit) {
    case TimeUnit.Nanosecond:
      return this.inner.timespan * 10 ** 6;
    case TimeUnit.Microsecond:
      return this.inner.timespan * 10 ** 3;
    case TimeUnit.Millisecond:
      return this.inner.timespan;
    case TimeUnit.Second:
      return Math.round(this.inner.timespan / 1000);
    case TimeUnit.Minute:
      return Math.round(this.inner.timespan / 1000 / 60);
    case TimeUnit.Hour:
      return Math.round(this.inner.timespan / 1000 / 60 / 60);
    case TimeUnit.Day:
      return Math.round(this.inner.timespan / 1000 / 60 / 60 / 24);
    }
  }