diff --git a/src/vs/workbench/services/timer/browser/timerService.ts b/src/vs/workbench/services/timer/browser/timerService.ts index 59e035f6734..0745c7fdeb6 100644 --- a/src/vs/workbench/services/timer/browser/timerService.ts +++ b/src/vs/workbench/services/timer/browser/timerService.ts @@ -358,13 +358,10 @@ export const ITimerService = createDecorator('timerService'); class PerfMarks { - private readonly _entries = new Map(); + private readonly _entries: [string, perf.PerformanceMark[]][] = []; setMarks(source: string, entries: perf.PerformanceMark[]): void { - if (this._entries.has(source)) { - throw new Error(`${source} EXISTS already`); - } - this._entries.set(source, entries); + this._entries.push([source, entries]); } getDuration(from: string, to: string): number { @@ -380,17 +377,17 @@ class PerfMarks { } private _findEntry(name: string): perf.PerformanceMark | void { - for (let entries of this._entries.values()) { - for (let i = entries.length - 1; i >= 0; i--) { - if (entries[i].name === name) { - return entries[i]; + for (let [, marks] of this._entries) { + for (let i = marks.length - 1; i >= 0; i--) { + if (marks[i].name === name) { + return marks[i]; } } } } getEntries() { - return Array.from(this._entries); + return this._entries.slice(0); } }