#stopwatch #timing

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

#178 in Date and time

Download history 938/week @ 2023-02-09 938/week @ 2023-02-16 1150/week @ 2023-02-23 542/week @ 2023-03-02 664/week @ 2023-03-09 895/week @ 2023-03-16 854/week @ 2023-03-23 643/week @ 2023-03-30 760/week @ 2023-04-06 676/week @ 2023-04-13 539/week @ 2023-04-20 686/week @ 2023-04-27 761/week @ 2023-05-04 916/week @ 2023-05-11 930/week @ 2023-05-18 795/week @ 2023-05-25

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

~235KB