| Crates.io | hrsw |
| lib.rs | hrsw |
| version | 0.1.2 |
| created_at | 2019-07-21 18:26:24.925073+00 |
| updated_at | 2021-04-04 23:17:11.901313+00 |
| description | This is a simple, high resolution stopwatch library. |
| homepage | |
| repository | https://github.com/antaljanosbenjamin/rust-hr-stopwatch |
| max_upload_size | |
| id | 150598 |
| size | 14,178 |
This library is a simple stopwatch implementation based on std::time::SystemTime. This library can also be found on crates.io.
To use this library you only have to add to your Cargo.toml as a dependency:
[dependencies]
hrsw = "0.1.2"
use hrsw::Stopwatch;
let mut stopwatch = Stopwatch::new();
stopwatch.start();
// do something and get the elapsed time
let elapsed = stopwatch.elapsed();
// do something other and get the total elapsed time
stopwatch.stop();
let total_elapsed = stopwatch.elapsed();
All kinds of contribution is very welcomed, so please feel free to create an issue, a pull request or ask me anything about the library!