Library + CLI utility to measure the TTFB (time to first byte) of HTTP(S)
requests. This includes data of intermediate steps, such as the relative and
absolute timings of DNS lookup, TCP connect, and TLS handshake.
usettfb::TtfbError;/// This test succeeds if `ttfb::ttfb()` doesn't raise a panic.
#[test]fncan_run_ttfb_lib_from_tokio_runtime(){let tokio =tokio::runtime::Builder::new_current_thread().build().unwrap();
tokio.block_on(async {let ttfb =ttfb::ttfb("http://localhost:1",false);match ttfb {Err(TtfbError::CantConnectTcp(_))=>{}_=>panic!("Unexpected result: {ttfb:#?}"),}});}