#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

#341 in Date and time

Download history 825/week @ 2024-03-03 1021/week @ 2024-03-10 968/week @ 2024-03-17 952/week @ 2024-03-24 790/week @ 2024-03-31 655/week @ 2024-04-07 935/week @ 2024-04-14 1018/week @ 2024-04-21 1121/week @ 2024-04-28 745/week @ 2024-05-05 775/week @ 2024-05-12 879/week @ 2024-05-19 966/week @ 2024-05-26 1208/week @ 2024-06-02 552/week @ 2024-06-09 819/week @ 2024-06-16

3,643 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

~465KB