index : stopwatch.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2024-01-14 18:30:55.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2024-01-14 18:36:36.0 +00:00:00
commit
7e70d7183f890ba275ab9ef9566f3a7710507973 [patch]
tree
2d2cbc13103c0b867b2d4339d155e724cc041e28
parent
061eea0f03733b7b04d02d0b2379ab23c4c35050
download
main.tar.gz

chore(docs): update readme



Diff

 README.md | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c42d58f..e6ec9eb 100644
--- a/README.md
+++ b/README.md
@@ -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.