Skip to content

Commit

Permalink
Use performance.now() to replace Date.now() (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored May 5, 2023
1 parent cc98762 commit cb8b206
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function initializeExtension(_operationId: string, context: vscode.Extensi
initRecommendations(context);
initDaemon(context);

activatedTimestamp = Date.now();

This comment has been minimized.

Copy link
@MartynaCzubek90

MartynaCzubek90 Aug 30, 2023

qodesmith/update-exported-packages

activatedTimestamp = performance.now();

This comment has been minimized.

Copy link
@MartynaCzubek90

MartynaCzubek90 Aug 30, 2023

qodesmith/update-exported-packages

if(context.storageUri) {
const javaWorkspaceStoragePath = path.join(context.storageUri.fsPath, "..", "redhat.java");
cleanJavaWorkspaceIndicator = path.join(javaWorkspaceStoragePath, "jdt_ws", ".cleanWorkspace");
Expand Down Expand Up @@ -100,11 +100,10 @@ function initializeTelemetry(_context: vscode.ExtensionContext) {
}

export async function deactivate() {
const now = Date.now();
const now = performance.now();
const data = {
name: "sessionStatus",
timestamp: now.toString(),
time: now - activatedTimestamp
time: Math.round(now - activatedTimestamp)
}
if (cleanJavaWorkspaceIndicator && fs.existsSync(cleanJavaWorkspaceIndicator)) {
data.name = "cleanJavaLSWorkspace";

This comment has been minimized.

Copy link
@MartynaCzubek90

MartynaCzubek90 Aug 30, 2023

qodesmith/update-exported-packages

Expand Down

1 comment on commit cb8b206

@MartynaCzubek90
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`qodesmith/update-exported-packages``

Please sign in to comment.