#timing #time

stopwatch

A stopwatch library for timing things

6 releases

Uses old Rust 2015

0.0.7 May 14, 2016
0.0.6 Aug 6, 2015
0.0.5 Mar 3, 2015
0.0.4 Jan 21, 2015

#330 in Date and time

Download history 634/week @ 2024-10-27 623/week @ 2024-11-03 633/week @ 2024-11-10 610/week @ 2024-11-17 755/week @ 2024-11-24 821/week @ 2024-12-01 1129/week @ 2024-12-08 957/week @ 2024-12-15 634/week @ 2024-12-22 336/week @ 2024-12-29 903/week @ 2025-01-05 1120/week @ 2025-01-12 1121/week @ 2025-01-19 603/week @ 2025-01-26 1450/week @ 2025-02-02 1172/week @ 2025-02-09

4,385 downloads per month
Used in 31 crates (29 directly)

MIT license

3KB
65 lines

rust-stopwatch

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

Build Status

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

Dependencies

~240KB