@@ -25,22 +25,26 @@ export function mark(label: string): void {
2525 */
2626export async function reportTimings ( ) : Promise < void > {
2727 if ( ! isEnabled ) return ;
28-
29- console . log ( '\n📊 Performance Profile: ' ) ;
28+
29+ console . log ( '\n📊 Performance Profile Results ' ) ;
3030 console . log ( '=======================' ) ;
31-
31+ console . log (
32+ `${ 'Label' . padEnd ( 40 , ' ' ) } ${ 'Time' . padStart ( 10 , ' ' ) } ${ 'Duration' . padStart ( 10 , ' ' ) } ` ,
33+ ) ;
34+
3235 // Sort timings by time value
33- const sortedTimings = Object . entries ( timings )
34- . sort ( ( a , b ) => a [ 1 ] - b [ 1 ] ) ;
35-
36+ const sortedTimings = Object . entries ( timings ) . sort ( ( a , b ) => a [ 1 ] - b [ 1 ] ) ;
37+
3638 // Calculate durations between steps
3739 let previousTime = 0 ;
3840 for ( const [ label , time ] of sortedTimings ) {
3941 const duration = time - previousTime ;
40- console . log ( `${ label } : ${ time . toFixed ( 2 ) } ms (${ duration . toFixed ( 2 ) } ms)` ) ;
42+ console . log (
43+ `${ label . padEnd ( 40 , ' ' ) } ${ `${ time . toFixed ( 2 ) } ms` . padStart ( 10 , ' ' ) } ${ `${ duration . toFixed ( 2 ) } ms` . padStart ( 10 , ' ' ) } ` ,
44+ ) ;
4145 previousTime = time ;
4246 }
43-
47+
4448 console . log ( `Total startup time: ${ previousTime . toFixed ( 2 ) } ms` ) ;
4549 console . log ( '=======================\n' ) ;
4650
@@ -55,34 +59,37 @@ export async function reportTimings(): Promise<void> {
5559 */
5660async function reportPlatformInfo ( ) : Promise < void > {
5761 if ( ! isEnabled ) return ;
58-
62+
5963 console . log ( '\n🖥️ Platform Information:' ) ;
6064 console . log ( '=======================' ) ;
6165 console . log ( `Platform: ${ process . platform } ` ) ;
6266 console . log ( `Architecture: ${ process . arch } ` ) ;
6367 console . log ( `Node.js version: ${ process . version } ` ) ;
64-
68+
6569 // Windows-specific information
6670 if ( process . platform === 'win32' ) {
6771 console . log ( 'Windows-specific details:' ) ;
6872 console . log ( `- Current working directory: ${ process . cwd ( ) } ` ) ;
6973 console . log ( `- Path length: ${ process . cwd ( ) . length } characters` ) ;
70-
74+
7175 // Check for antivirus markers by measuring file read time
7276 try {
7377 // Using dynamic import to avoid require
7478 const fs = await import ( 'fs' ) ;
7579 const startTime = performance . now ( ) ;
7680 fs . readFileSync ( process . execPath ) ;
77- console . log ( `- Time to read Node.js executable: ${ ( performance . now ( ) - startTime ) . toFixed ( 2 ) } ms` ) ;
81+ console . log (
82+ `- Time to read Node.js executable: ${ ( performance . now ( ) - startTime ) . toFixed ( 2 ) } ms` ,
83+ ) ;
7884 } catch ( error : unknown ) {
79- const errorMessage = error instanceof Error ? error . message : String ( error ) ;
85+ const errorMessage =
86+ error instanceof Error ? error . message : String ( error ) ;
8087 console . log ( `- Error reading Node.js executable: ${ errorMessage } ` ) ;
8188 }
8289 }
83-
90+
8491 console . log ( '=======================\n' ) ;
8592}
8693
8794// Initial mark for module load time
88- mark ( 'Module initialization' ) ;
95+ mark ( 'Module initialization' ) ;
0 commit comments