@@ -153,14 +153,15 @@ async function io_worker(worker_id, io_worker_id) {
153153 const start_time = Date . now ( ) ;
154154 const end_time = start_time + ( argv . time * 1000 ) ;
155155 for ( ; ; ) {
156- const file_start_time = Date . now ( ) ;
157- if ( file_start_time >= end_time ) break ;
156+ const now = Date . now ( ) ;
157+ if ( now >= end_time ) break ;
158+ const start = process . hrtime . bigint ( ) ;
158159 let file_path ;
159- const hash_dir = path . join ( dir , String ( file_start_time % 256 ) ) ;
160+ const hash_dir = path . join ( dir , String ( now % 256 ) ) ;
160161 if ( argv . read ) {
161162 file_path = _read_files [ crypto . randomInt ( 0 , _read_files . length ) ] ;
162163 } else {
163- file_path = path . join ( hash_dir , `file${ size_name } -${ file_start_time . toString ( 36 ) } ` ) ;
164+ file_path = path . join ( hash_dir , `file${ size_name } -${ now . toString ( 36 ) } ` ) ;
164165 }
165166 try {
166167 if ( argv . mode === 'nsfs' ) {
@@ -170,7 +171,7 @@ async function io_worker(worker_id, io_worker_id) {
170171 } else if ( argv . mode === 'dd' ) {
171172 await work_with_dd ( file_path , end_time ) ;
172173 }
173- const took_ms = Date . now ( ) - file_start_time ;
174+ const took_ms = Number ( process . hrtime . bigint ( ) - start ) / 1e6 ;
174175 speedometer . update ( 0 , took_ms ) ;
175176 } catch ( err ) {
176177 if ( err . code === 'ENOENT' ) {
0 commit comments