Rust中的基准测试程序 [英] Benchmarking programs in Rust
本文介绍了Rust中的基准测试程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Rust中对程序进行基准测试?例如,如何获得以秒为单位的程序执行时间?
How is it possible to benchmark programs in Rust? For example, how would I get execution time of program in seconds?
推荐答案
此答案已过时!在基准测试方面,
time
板条箱与std::time
板相比没有任何优势.请查看下面的答案以获取最新信息.
This answer is outdated! The
time
crate does not offer any advantages overstd::time
in regards to benchmarking. Please see the answers below for up to date information.
您可以尝试使用时间板条箱对程序中的各个组件进行计时.
You might try timing individual components within the program using the time crate.
这篇关于Rust中的基准测试程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文