Expand description
Tracking progress on repetive tasks and measuring remaining times.
§Usage
Add this to your Cargo.toml
:
[dependencies]
eta = "0.2.2"
and this to your source code:
use eta::{Eta,TimeAcc};
§Example
use eta::{Eta,TimeAcc};
fn calculate_square (number: usize) -> usize {
number * number
}
fn main() {
let count = 100;
let numbers = Vec::from_iter(0..count);
let mut eta = Eta::new(count, TimeAcc::MILLI);
for number in numbers {
calculate_square(number);
eta.step();
if (number % 10) == 0 {
println!("{}", eta);
}
}
}
Structs§
- Eta
Eta
is the main object which keep track of task count and elapsed times. It implements several methods to display various information about the progress.
Enums§
- TimeAcc
TimeAcc
determines the accuracy of the time measurement.