File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -3256,22 +3256,21 @@ mod tests {
3256
3256
let conn = endpoint. connect ( * id, NOOP_ALPN ) . await ?;
3257
3257
conn. close ( 0u32 . into ( ) , b"done" ) ;
3258
3258
}
3259
- let dt0 = t0. elapsed ( ) ;
3259
+ let dt0 = t0. elapsed ( ) . as_secs_f64 ( ) ;
3260
3260
let t1 = Instant :: now ( ) ;
3261
3261
for id in & ids {
3262
3262
let conn = endpoint. connect ( * id, NOOP_ALPN ) . await ?;
3263
3263
conn. close ( 0u32 . into ( ) , b"done" ) ;
3264
3264
}
3265
- let dt1 = t1. elapsed ( ) ;
3266
- println ! (
3267
- "Round 0: {}s, {}s per connection" ,
3268
- dt0. as_secs_f64( ) ,
3269
- dt0. as_secs_f64( ) / ( n as f64 )
3270
- ) ;
3271
- println ! (
3272
- "Round 1: {}s, {}s per connection" ,
3273
- dt1. as_secs_f64( ) ,
3274
- dt1. as_secs_f64( ) / ( n as f64 )
3265
+ let dt1 = t1. elapsed ( ) . as_secs_f64 ( ) ;
3266
+
3267
+ println ! ( "Round 0: {}s, {}s per connection" , dt0, dt0 / ( n as f64 ) ) ;
3268
+ println ! ( "Round 1: {}s, {}s per connection" , dt1, dt1 / ( n as f64 ) ) ;
3269
+ assert ! (
3270
+ dt0 / dt1 < 20.0 ,
3271
+ "First round: {}s, second round {}s" ,
3272
+ dt0,
3273
+ dt1
3275
3274
) ;
3276
3275
Ok ( ( ) )
3277
3276
}
You can’t perform that action at this time.
0 commit comments