@@ -3,6 +3,7 @@ import { type ElectronApplication, type Page } from '@playwright/test';
33import { openCollection , closeAllCollections } from '../../utils/page' ;
44import { summarize } from '../utils/stats' ;
55import { writeResults , buildResultEntry , type ResultEntry } from '../utils/results' ;
6+ import { startTimer } from '../utils/timing' ;
67import { generateCollection , type CollectionFormat } from '../utils/collection-generator' ;
78import * as path from 'path' ;
89import * as fs from 'fs' ;
@@ -35,7 +36,7 @@ async function measureCollectionMount(
3536 } ) ;
3637 } ) ;
3738
38- const start = performance . now ( ) ;
39+ const timer = startTimer ( ) ;
3940
4041 await page . getByTestId ( 'collections-header-add-menu' ) . click ( ) ;
4142 await page . locator ( '.tippy-box .dropdown-item' ) . filter ( { hasText : 'Open collection' } ) . click ( ) ;
@@ -44,7 +45,7 @@ async function measureCollectionMount(
4445 await openCollection ( page , collectionName ) ;
4546 await page . evaluate ( ( ) => ( window as any ) . __benchMountDone ) ;
4647
47- const elapsed = performance . now ( ) - start ;
48+ const elapsed = timer . elapsed ( ) ;
4849
4950 await electronApp . evaluate ( ( { dialog } ) => {
5051 if ( ( dialog as any ) . __originalShowOpenDialog ) {
@@ -77,7 +78,7 @@ test.describe('Benchmark: Collection Mount', () => {
7778
7879 for ( let i = 0 ; i < ITERATIONS_PER_SIZE ; i ++ ) {
7980 const elapsed = await measureCollectionMount ( page , electronApp , collectionDir , collectionName ) ;
80- timings . push ( Math . round ( elapsed ) ) ;
81+ timings . push ( elapsed ) ;
8182 }
8283
8384 const key = resultKey ( format , size ) ;
0 commit comments