MCPcopy Index your code
hub / github.com/epicweb-dev/epic-stack / makeTimings

Function makeTimings

app/utils/timing.server.ts:13–24  ·  view source on GitHub ↗
(type: string, desc?: string)

Source from the content-addressed store, hash-verified

11>
12
13export function makeTimings(type: string, desc?: string) {
14 const timings: Timings = {
15 [type]: [{ desc, start: performance.now() }],
16 }
17 Object.defineProperty(timings, 'toString', {
18 value: function () {
19 return getServerTimeHeader(timings)
20 },
21 enumerable: false,
22 })
23 return timings
24}
25
26function createTimer(type: string, desc?: string) {
27 const start = performance.now()

Callers 3

handleRequestFunction · 0.90
loaderFunction · 0.90
loaderFunction · 0.90

Calls 1

getServerTimeHeaderFunction · 0.85

Tested by

no test coverage detected