Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/notebook/common/notebookPerformance.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
export type PerfName = 'startTime' | 'extensionActivated' | 'inputLoaded' | 'webviewCommLoaded' | 'customMarkdownLoaded' | 'editorLoaded';
7
8
type PerformanceMark = { [key in PerfName]?: number };
9
10
export class NotebookPerfMarks {
11
private _marks: PerformanceMark = {};
12
13
get value(): PerformanceMark {
14
return { ...this._marks };
15
}
16
17
mark(name: PerfName): void {
18
if (this._marks[name]) {
19
console.error(`Skipping overwrite of notebook perf value: ${name}`);
20
return;
21
}
22
23
this._marks[name] = Date.now();
24
}
25
}
26
27