0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 05:28:35 +00:00
renovatebot_renovate/lib/util/split.ts
2020-05-08 10:18:00 +02:00

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 };
}