MCPcopy Index your code
hub / github.com/angular/angular / since

Method since

packages/service-worker/worker/src/debug.ts:78–100  ·  view source on GitHub ↗
(time: number | null)

Source from the content-addressed store, hash-verified

76 }
77
78 since(time: number | null): string {
79 if (time === null) {
80 return 'never';
81 }
82 let age = this.adapter.time - time;
83 const days = Math.floor(age / 86400000);
84 age = age % 86400000;
85 const hours = Math.floor(age / 3600000);
86 age = age % 3600000;
87 const minutes = Math.floor(age / 60000);
88 age = age % 60000;
89 const seconds = Math.floor(age / 1000);
90 const millis = age % 1000;
91
92 return (
93 '' +
94 (days > 0 ? `${days}d` : '') +
95 (hours > 0 ? `${hours}h` : '') +
96 (minutes > 0 ? `${minutes}m` : '') +
97 (seconds > 0 ? `${seconds}s` : '') +
98 (millis > 0 ? `${millis}u` : '')
99 );
100 }
101
102 log(value: string | Error, context: string = ''): void {
103 // Rotate the buffers if debugLogA has grown too large.

Callers 2

handleFetchMethod · 0.95
formatDebugLogMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected