ellisonch
rust-stopwatch
Rust

A stopwatch library for Rust. Used to time things.

Last updated Jan 18, 2026
84
Stars
21
Forks
5
Issues
0
Stars/day
Attention Score
18
Language breakdown
Rust 100.0%
โ–ธ Files click to expand
README

rust-stopwatch

This is a simple module used to time things in Rust.

Build Status

Usage

To use, add the following line to Cargo.toml under [dependencies]:
stopwatch = "0.0.7"
or alternatively,
stopwatch = { git = "https://github.com/ellisonch/rust-stopwatch.git" }

Example

extern crate stopwatch;
use stopwatch::{Stopwatch};
// ...
let sw = Stopwatch::start_new();
// do something that takes some time
println!("Thing took {}ms", sw.elapsed_ms());

Methods

fn new() -> Stopwatch
fn start_new() -> Stopwatch
fn start(&mut self)
fn stop(&mut self)
fn reset(&mut self)
fn restart(&mut self)
fn is_running(&self) -> bool
fn elapsed(&self) -> Duration
fn elapsed_ms(&self) -> i64
๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท ellisonch/rust-stopwatch ยท Updated daily from GitHub