| Crates.io | http-timings |
| lib.rs | http-timings |
| version | 0.3.1 |
| created_at | 2024-04-12 19:54:42.941334+00 |
| updated_at | 2025-12-18 02:07:48.456547+00 |
| description | A simple library to measure the key HTTP timings from the development tools |
| homepage | |
| repository | https://github.com/metrixweb/http-timings |
| max_upload_size | |
| id | 1206824 |
| size | 38,473 |
Inspired by the libraries TTFB by phip1611 and ssl-expiration by onur. This library provides the following information from any given URL:
use http_timings::from_string;
let url = "https://www.example.com";
let timeout = Some(Duration::from_secs(5)); // Set a timeout of 5 seconds
match from_string(url, timeout) {
Ok(response) => {
println!("Response Status: {}", response.status);
println!("Response Body: {}", response.body.string());
if let Some(cert_info) = response.certificate_information {
println!("Certificate Subject: {:?}", cert_info.subject);
println!("Certificate Issued At: {:?}", cert_info.issued_at);
println!("Certificate Expires At: {:?}", cert_info.expires_at);
println!("Is Certificate Active: {:?}", cert_info.is_active);
} else {
println!("No certificate information available.");
}
},
Err(e) => {
eprintln!("Error occurred: {:?}", e);
}
}
The Response struct provides all the information about the request. The timings in both relative and total terms. The relative timings are the time taken for each step of the request, while the total timings are the time taken from the start of the request to the end of the request.
The URL input can be any valid website as well as any valid IP.