mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 05:28:35 +00:00
19 lines
387 B
TypeScript
19 lines
387 B
TypeScript
let startTime = 0;
|
|
let lastTime = 0;
|
|
let splits: Record<string, number> = {};
|
|
|
|
export function splitInit(): void {
|
|
splits = {};
|
|
startTime = Date.now();
|
|
lastTime = startTime;
|
|
}
|
|
|
|
export function addSplit(name: string): void {
|
|
splits[name] = Date.now() - lastTime;
|
|
lastTime = Date.now();
|
|
}
|
|
|
|
export function getSplits(): any {
|
|
return { splits, total: Date.now() - startTime };
|
|
}
|