howlong 0.1.1

Measure how long it takes for a program to execute in different clocks
Documentation

howlong

Build Status Latest Version Rust Documentation

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, SystemTimer
  • SteadyClock, SteadyTimer if supported by the system.
  • HighResolutionClock, HighResolutionTimer
  • ProcessRealCPUClock, ProcessRealCPUTimer
  • ProcessUserCPUClock, ProcessUserCPUTimer
  • ProcessSystemCPUClock, ProcessSystemCPUTimer
  • ProcessCPUClock, ProcessCPUTimer
  • ThreadClock, ThreadTimer

Documentation

https://doc.rs/howlong

Usage

Add this to your Cargo.toml:

[dependencies]
howlong = "0.1"

Examples

use howlong::*;

let timer = HighResolutionTimer::new();
// do some computations
println!("{:?} have passed.", timer.elapsed());

let timer = ProcessCPUTimer::new();
// do other computations
println!("{}", timer.elapsed());

License