console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.21k stars 238 forks source link

Feature Req.: Human readable `per_sec` rate #637

Open amandasaurus opened 3 months ago

amandasaurus commented 3 months ago

I am using indicatif to process lots of data, and it's great. My programme does hundreds of thousands to millions of iterations of second. The {per_sec} template will show me the rate to 4 decimal places (e.g. 120,399,714.0565/s). That's too many numbers.

Can we get a per_sec_human template variable which will print something like 120 M/s in this case?

djc commented 3 months ago

If you submit a PR I'd be okay with reviewing/merging it. Arguably the human formatting should have been more like an orthogonal filter from the start...