#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

#33 in Date and time

Download history 1266/week @ 2021-02-20 1128/week @ 2021-02-27 1340/week @ 2021-03-06 1208/week @ 2021-03-13 1438/week @ 2021-03-20 1737/week @ 2021-03-27 1132/week @ 2021-04-03 1520/week @ 2021-04-10 953/week @ 2021-04-17 730/week @ 2021-04-24 742/week @ 2021-05-01 790/week @ 2021-05-08 983/week @ 2021-05-15 824/week @ 2021-05-22 958/week @ 2021-05-29 1019/week @ 2021-06-05

4,940 downloads per month
Used in 19 crates (18 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

~220KB