chore: Initial commit

This commit is contained in:
Daniël Groothuis
2025-10-29 14:26:01 +01:00
commit 6e96ae4c98
286 changed files with 36273 additions and 0 deletions

19
quartz/util/perf.ts Normal file
View File

@@ -0,0 +1,19 @@
import pretty from "pretty-time"
import { styleText } from "util"
export class PerfTimer {
evts: { [key: string]: [number, number] }
constructor() {
this.evts = {}
this.addEvent("start")
}
addEvent(evtName: string) {
this.evts[evtName] = process.hrtime()
}
timeSince(evtName?: string): string {
return styleText("yellow", pretty(process.hrtime(this.evts[evtName ?? "start"])))
}
}