6 个版本
使用旧的 Rust 2015
0.0.7 | 2016 年 5 月 14 日 |
---|---|
0.0.6 | 2015 年 8 月 6 日 |
0.0.5 | 2015 年 3 月 3 日 |
0.0.4 | 2015 年 1 月 21 日 |
#341 在 日期和时间 中
3,643 每月下载量
用于 29 个 Crates(27 个直接使用)
3KB
65 行
rust-stopwatch
这是一个用于在 Rust 中计时的简单模块。
示例
extern crate stopwatch;
use stopwatch::{Stopwatch};
// ...
let sw = Stopwatch::start_new();
// do something that takes some time
println!("Thing took {}ms", sw.elapsed_ms());
方法
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
依赖项
~465KB