MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / SecondsNanoseconds

Function SecondsNanoseconds

src/utils/normalizeStats.js:5–20  ·  view source on GitHub ↗
(
  givenSeconds,
  givenNanoseconds,
  milliseconds,
  date
)

Source from the content-addressed store, hash-verified

3const MAX_UINT32 = 2 ** 32
4
5function SecondsNanoseconds(
6 givenSeconds,
7 givenNanoseconds,
8 milliseconds,
9 date
10) {
11 if (givenSeconds !== undefined && givenNanoseconds !== undefined) {
12 return [givenSeconds, givenNanoseconds]
13 }
14 if (milliseconds === undefined) {
15 milliseconds = date.valueOf()
16 }
17 const seconds = Math.floor(milliseconds / 1000)
18 const nanoseconds = (milliseconds - seconds * 1000) * 1000000
19 return [seconds, nanoseconds]
20}
21
22export function normalizeStats(e) {
23 const [ctimeSeconds, ctimeNanoseconds] = SecondsNanoseconds(

Callers 1

normalizeStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…