chore(docs): update readme
Diff
README.md | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
@@ -2,9 +2,33 @@
A small stopwatch library written in Rust.
## Usage
```rust
use std::time::Duration;
use stopwatch::Stopwatch;
let mut stopwatch = Stopwatch::new();
stopwatch.start();
// Do a long running task
std::thread::sleep(Duration::from_secs(5));
stopwatch.stop();
println!("Operation complete in: {}", stopwatch);
```
## Installation
```shell
cargo add --git https://git.holly.sh/stopwatch.git
```
## Why does this exist?
While there is the [rust-stopwatch](https://crates.io/crates/stopwatch) crate, I didn't like that a simple stopwatch crate had a dependency on [num](https://crates.io/crates/num).
While there is the [rust-stopwatch](https://crates.io/crates/stopwatch) crate, I didn't like that a simple stopwatch crate had a dependency on [num](https://crates.io/crates/num), which has other dependencies.
This is done in pure Rust.