@@ -115,7 +115,7 @@ export class InlineCompletionManager implements Disposable {
115115 const startLine = position . line
116116 // TODO: also log the seen state for other suggestions in session
117117 // Calculate timing metrics before diagnostic delay
118- const totalSessionDisplayTime = performance . now ( ) - requestStartTime
118+ const totalSessionDisplayTime = Date . now ( ) - requestStartTime
119119 await sleep ( 500 )
120120 const diagnosticDiff = getDiagnosticsDifferences (
121121 this . sessionManager . getActiveSession ( ) ?. diagnosticsBeforeAccept ,
@@ -175,7 +175,7 @@ export class InlineCompletionManager implements Disposable {
175175 return
176176 }
177177 const requestStartTime = session . requestStartTime
178- const totalSessionDisplayTime = performance . now ( ) - requestStartTime
178+ const totalSessionDisplayTime = Date . now ( ) - requestStartTime
179179 await commands . executeCommand ( 'editor.action.inlineSuggest.hide' )
180180 // TODO: also log the seen state for other suggestions in session
181181 this . disposable . dispose ( )
@@ -249,7 +249,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
249249 // Use VS Code command to check if inline suggestion is actually visible on screen
250250 // This command only executes when inlineSuggestionVisible context is true
251251 await vscode . commands . executeCommand ( 'aws.amazonq.checkInlineSuggestionVisibility' )
252- const isInlineSuggestionVisible = performance . now ( ) - session . lastVisibleTime < 50
252+ const isInlineSuggestionVisible = Date . now ( ) - session . lastVisibleTime < 50
253253 return isInlineSuggestionVisible
254254 }
255255
@@ -278,7 +278,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
278278 sessionId : session . sessionId ,
279279 completionSessionResult,
280280 firstCompletionDisplayLatency : session . firstCompletionDisplayLatency ,
281- totalSessionDisplayTime : performance . now ( ) - session . requestStartTime ,
281+ totalSessionDisplayTime : Date . now ( ) - session . requestStartTime ,
282282 }
283283 this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
284284 }
@@ -309,7 +309,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
309309 // when hitting other keystrokes, the context.triggerKind is Automatic (1)
310310 // we only mark option + C as manual trigger
311311 // this is a workaround since the inlineSuggest.trigger command take no params
312- const isAutoTrigger = performance . now ( ) - vsCodeState . lastManualTriggerTime > 50
312+ const isAutoTrigger = Date . now ( ) - vsCodeState . lastManualTriggerTime > 50
313313 if ( isAutoTrigger && ! CodeSuggestionsState . instance . isSuggestionsEnabled ( ) ) {
314314 // return early when suggestions are disabled with auto trigger
315315 return [ ]
@@ -318,9 +318,9 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
318318 // yield event loop to let the document listen catch updates
319319 await sleep ( 1 )
320320
321- let logstr = `GenerateCompletion metadata :\\n`
321+ let logstr = `GenerateCompletion activity :\\n`
322322 try {
323- const t0 = performance . now ( )
323+ const t0 = Date . now ( )
324324 vsCodeState . isRecommendationsActive = true
325325 // handling previous session
326326 const prevSession = this . sessionManager . getActiveSession ( )
@@ -365,7 +365,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
365365 // re-use previous suggestions as long as new typed prefix matches
366366 if ( prevItemMatchingPrefix . length > 0 ) {
367367 logstr += `- not call LSP and reuse previous suggestions that match user typed characters
368- - duration between trigger to completion suggestion is displayed ${ performance . now ( ) - t0 } `
368+ - duration between trigger to completion suggestion is displayed ${ Date . now ( ) - t0 } `
369369 void this . checkWhetherInlineCompletionWasShown ( )
370370 return prevItemMatchingPrefix
371371 }
@@ -381,7 +381,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
381381 } ,
382382 } ,
383383 firstCompletionDisplayLatency : prevSession . firstCompletionDisplayLatency ,
384- totalSessionDisplayTime : performance . now ( ) - prevSession . requestStartTime ,
384+ totalSessionDisplayTime : Date . now ( ) - prevSession . requestStartTime ,
385385 }
386386 this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
387387 this . sessionManager . clear ( )
@@ -396,7 +396,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
396396 TelemetryHelper . instance . setInvokeSuggestionStartTime ( )
397397 TelemetryHelper . instance . setTriggerType ( context . triggerKind )
398398
399- const t1 = performance . now ( )
399+ const t1 = Date . now ( )
400400
401401 await this . recommendationService . getAllRecommendations (
402402 this . languageClient ,
@@ -418,7 +418,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
418418 // eslint-disable-next-line @typescript-eslint/no-base-to-string
419419 const itemLog = items [ 0 ] ? `${ items [ 0 ] . insertText . toString ( ) } ` : `no suggestion`
420420
421- const t2 = performance . now ( )
421+ const t2 = Date . now ( )
422422
423423 logstr += `- number of suggestions: ${ items . length }
424424- sessionId: ${ this . sessionManager . getActiveSession ( ) ?. sessionId }
@@ -468,7 +468,7 @@ ${itemLog}
468468 const lastDocumentChange = this . documentEventListener . getLastDocumentChangeEvent ( document . uri . fsPath )
469469 if (
470470 lastDocumentChange &&
471- performance . now ( ) - lastDocumentChange . timestamp < CodeWhispererConstants . inlineSuggestionShowDelay
471+ Date . now ( ) - lastDocumentChange . timestamp < CodeWhispererConstants . inlineSuggestionShowDelay
472472 ) {
473473 await sleep ( CodeWhispererConstants . showRecommendationTimerPollPeriod )
474474 } else {
@@ -486,7 +486,7 @@ ${itemLog}
486486 // Check if Next Edit Prediction feature flag is enabled
487487 if ( Experiments . instance . get ( 'amazonqLSPNEP' , true ) ) {
488488 await showEdits ( item , editor , session , this . languageClient , this )
489- logstr += `- duration between trigger to edits suggestion is displayed: ${ performance . now ( ) - t0 } ms`
489+ logstr += `- duration between trigger to edits suggestion is displayed: ${ Date . now ( ) - t0 } ms`
490490 }
491491 return [ ]
492492 }
@@ -530,7 +530,7 @@ ${itemLog}
530530
531531 this . sessionManager . updateCodeReferenceAndImports ( )
532532 // suggestions returned here will be displayed on screen
533- logstr += `- duration between trigger to completion suggestion is displayed: ${ performance . now ( ) - t0 } ms`
533+ logstr += `- duration between trigger to completion suggestion is displayed: ${ Date . now ( ) - t0 } ms`
534534 void this . checkWhetherInlineCompletionWasShown ( )
535535 return itemsMatchingTypeahead as InlineCompletionItem [ ]
536536 } catch ( e ) {
0 commit comments