(input: OtelApi.TimeInput | undefined, clock: Clock.Clock)
| 330 | (Array.isArray(u) && u.length === 2 && typeof u[0] === "number" && typeof u[1] === "number") |
| 331 | |
| 332 | const convertOtelTimeInput = (input: OtelApi.TimeInput | undefined, clock: Clock.Clock): bigint => { |
| 333 | if (input === undefined) { |
| 334 | return clock.unsafeCurrentTimeNanos() |
| 335 | } else if (typeof input === "number") { |
| 336 | return BigInt(Math.round(input * 1_000_000)) |
| 337 | } else if (input instanceof Date) { |
| 338 | return BigInt(input.getTime()) * bigint1e6 |
| 339 | } |
| 340 | const [seconds, nanos] = input |
| 341 | return BigInt(seconds) * bigint1e9 + BigInt(nanos) |
| 342 | } |
| 343 | |
| 344 | /** @internal */ |
| 345 | export const currentOtelSpan: Effect.Effect<OtelApi.Span, Cause.NoSuchElementException> = Effect.clockWith((clock) => |
no test coverage detected