Devtimer
Operation benchmarking and timing library for Rust
Rationale
I've seen many, many benchmarking tools. However, no one realizes that we need simplicity to simplify development and increase productivity. I recently have been up with a lot of perf-testing and I seem to run into a huge need for timing tools. I was initially using std::time::Instant::now()
and then using the duration_since()
to find the difference between the two intervals. That was fine, not that it didn't work, but there was a lot of redundancy. So I made a simple library which is a wrapper around the standard library time
crate.
Usage
extern crate devtimer;
use DevTime;
Why are there no tests?
Well, there would be no possible test that I can think of that'd run uniformly across all systems. If I did something like:
let mut timer = new;
timer.start;
sleep;
timer.stop;
assert_eq!;
It can easily fail (and has failed) as system calls can take time and the time for them will differ across every system. This will necessarily pass on all systems, but when compared on a microsecond or nanosecond level, the tests have failed multiple times. Hence I decided to omit all tests from this crate.
License
This project is licensed under the Apache-2.0 License. You can virtually do anything with this crate! Just keep coding and benchmarking