@helia/verified-fetch
Version:
A fetch-like API for obtaining verified & trustless IPFS content on the web
21 lines • 624 B
JavaScript
export class ServerTiming {
headers;
constructor() {
this.headers = [];
}
getHeader() {
return this.headers.join(',');
}
async time(name, description, promise) {
const startTime = performance.now();
try {
return await promise; // Execute the function
}
finally {
const endTime = performance.now();
const duration = (endTime - startTime).toFixed(1); // Duration in milliseconds
this.headers.push(`${name};dur=${duration};desc="${description}"`);
}
}
}
//# sourceMappingURL=server-timing.js.map