perf view - show running total in raw view

pull/65786/head
Johannes Rieken 2018-12-28 18:31:01 +01:00
parent f886dd4fb8
commit c55cf4b241
1 changed files with 5 additions and 2 deletions

View File

@ -191,10 +191,13 @@ class PerfModelContentProvider implements ITextModelContentProvider {
private _addRawPerfMarks(md: MarkdownBuilder): void {
md.heading(2, 'Raw Perf Marks');
md.value += '```\n';
md.value += `Name\tTimestamp\tDelta\n`;
md.value += `Name\tTimestamp\tDelta\tTotal\n`;
let lastStartTime = -1;
let total = 0;
for (const { name, startTime } of perf.getEntries('mark')) {
md.value += `${name}\t${startTime}\t${lastStartTime !== -1 ? startTime - lastStartTime : 0}\n`;
let delta = lastStartTime !== -1 ? startTime - lastStartTime : 0;
total += delta;
md.value += `${name}\t${startTime}\t${delta}\t${total}\n`;
lastStartTime = startTime;
}
md.value += '```\n';