4 个版本
使用旧的 Rust 2015
0.0.5 | 2017年9月4日 |
---|---|
0.0.4 | 2017年9月4日 |
0.0.2 | 2017年9月4日 |
0.0.0 | 2017年8月31日 |
在 性能分析 中排名 307
8KB
163 行
easytiming
Rust 中函数、代码块等的简单计时
快速开始
使用 easytiming
的真正快速方法是这样的
extern crate easytiming;
use easytiming::Timing;
fn do_something() {
let _t = Timing::new("do_something() function");
...
}
运行后将生成以下输出
"do_something() function" was running for 410420 ns
lib.rs
:
easytiming 为 Rust 源代码中的函数、代码块和其他元素提供了计时测量工具。它足够灵活,可以适应不同的输出选项。它与 log
和 slog
兼容。它以基本形式在稳定版上运行。此外,在 nightly 版本中使用时,它可以作为属性调用(尚未实现)。
快速开始
use easytiming::Timing;
fn do_something() {
let _t: Timing = Timing::new("do_something() function");
// Do some important stuff here
// ...
}
依赖关系
~80KB