#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

#361 in Date and time

Download history 974/week @ 2024-07-20 910/week @ 2024-07-27 774/week @ 2024-08-03 1098/week @ 2024-08-10 632/week @ 2024-08-17 667/week @ 2024-08-24 728/week @ 2024-08-31 611/week @ 2024-09-07 684/week @ 2024-09-14 830/week @ 2024-09-21 828/week @ 2024-09-28 497/week @ 2024-10-05 564/week @ 2024-10-12 653/week @ 2024-10-19 607/week @ 2024-10-26 629/week @ 2024-11-02

2,520 downloads per month
Used in 30 crates (28 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