#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

#297 in Date and time

Download history 865/week @ 2023-12-04 1092/week @ 2023-12-11 1224/week @ 2023-12-18 740/week @ 2023-12-25 898/week @ 2024-01-01 1104/week @ 2024-01-08 866/week @ 2024-01-15 788/week @ 2024-01-22 851/week @ 2024-01-29 858/week @ 2024-02-05 846/week @ 2024-02-12 922/week @ 2024-02-19 761/week @ 2024-02-26 863/week @ 2024-03-04 989/week @ 2024-03-11 977/week @ 2024-03-18

3,623 downloads per month
Used in 29 crates (27 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

~470KB