mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-02 06:58:13 +00:00
fix relative path resolution in router and link crawling
This commit is contained in:
parent
232652149a
commit
2f6747b166
44 changed files with 160 additions and 106 deletions
quartz/util
19
quartz/util/perf.ts
Normal file
19
quartz/util/perf.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import chalk from "chalk"
|
||||
import pretty from "pretty-time"
|
||||
|
||||
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 chalk.yellow(pretty(process.hrtime(this.evts[evtName ?? "start"])))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue