howlong
This crate allows you to measure how long it takes for a program to execute in different clocks. It ports the functions of the boost-chrono and boost-timer libraries.
The following clocks and their corresponding timers are implemented.
SystemClock,SystemTimerSteadyClock,SteadyTimerif supported by the system.HighResolutionClock,HighResolutionTimerProcessRealCPUClock,ProcessRealCPUTimerProcessUserCPUClock,ProcessUserCPUTimerProcessSystemCPUClock,ProcessSystemCPUTimerProcessCPUClock,ProcessCPUTimerThreadClock,ThreadTimer
Documentation
Usage
Add this to your Cargo.toml:
[]
= "0.1"
Examples
let timer = new;
// do some computations
println!;
let timer = new;
// do other computations
println!; // 5.71s wall, 5.70s user + 0ns system = 5.70s CPU (99.8%)