MCPcopy Create free account
hub / github.com/Effect-TS/effect / nanosToHrTime

Function nanosToHrTime

packages/effect/src/Duration.ts:58–65  ·  view source on GitHub ↗
(nanos: bigint)

Source from the content-addressed store, hash-verified

56}
57
58const nanosToHrTime = (nanos: bigint): [seconds: number, nanos: number] => {
59 const sign = nanos < bigint0 ? -bigint1 : bigint1
60 const absolute = nanos < bigint0 ? -nanos : nanos
61 return [
62 Number(sign * (absolute / bigint1e9)),
63 Number(sign * (absolute % bigint1e9))
64 ]
65}
66
67/**
68 * Represents a span of time with high precision, supporting operations from

Callers 1

toHrTimeFunction · 0.70

Calls 1

NumberInterface · 0.70

Tested by

no test coverage detected