Comments (3)
I'm open to having the logic changed so that it shows milliseconds instead of seconds past some threshold. Are you able to submit a PR for this? I think it might be enough to add millisecond value to UNITS
here: https://github.com/console-rs/indicatif/blob/main/src/format.rs#L106.
from indicatif.
ooh, that definitely was easy!
🎯| 3s | ↙ test-spec-bun
🎯| 5s | ↙ test-spec-dom
🎯| 17ms | ↙ test-spec
🎯| 854ms | ↙ lint-ci
🎯| 7s | ↙ test-src-tsc
🎯| 353ms | ↙ build-lib-js
🎯| 953ms | ↙ test-src-import-restrictions
🎯| 42ms | ↙ test-src-scripts-consistency
🎯| 9ms | ↙ test-src
🎯| 121ms | ↙ build-bin
🎯| 14s | ↙ build-lib-types
🎯| 726ms | ↙ build-site-twizzle
🎯| 569ms | ↙ build-site-experiments
🎯| 14ms | ↙ build-sites
🎯| 8s | ↙ build-site-docs
🎯| 7ms | ↙ test-build
🎯| 4s | ↙ test-dist-lib-node-import
🎯| 10s | ↙ test-dist-lib-node-scramble-all-events
🎯| 4s | ↙ test-dist-lib-perf
🎯| 4s | ↙ test-dist-lib-plain-esbuild-compat
🎯| 4s | ↙ test-dist-lib-build-size
🎯| 2s | ↙ test-dist-sites-experiments
🎯| 7ms | ↙ test-dist-lib
🎯| 3s | ↙ test-dist-bin-shebang
🎯| 3s | ↙ test-dist-bin-npm-exec
🎯| 21ms | ↙ test-dist-bin
🎯| 7ms | ↙ test-dist
🎯| 6ms | test-all
Some thoughts:
- I can imagine that could result in undesirable increased visual activity / layout changes for some use cases. Should I try to make it opt-in?
- Should I leave
elapsed_precise
alone? - Would you be open to seconds with decimal digits? Times under 1000ms are accurate, but the precision drastically drops for times in the low seconds. It could also help with visual scanability, e.g. to avoid making
7ms
look "larger" than8s
.
If I could perfectly tune it, I'd probably go for this:
🎯| 2.20s | ↙ test-spec-bun
🎯| 5.02s | ↙ test-spec-dom
🎯| 0.01s | ↙ test-spec
🎯| 0.74s | ↙ lint-ci
🎯| 8.01s | ↙ test-src-tsc
🎯| 0.34s | ↙ build-lib-js
🎯| 0.76s | ↙ test-src-import-restrictions
🎯| 0.05s | ↙ test-src-scripts-consistency
🎯| 0.01s | ↙ test-src
🎯| 0.12s | ↙ build-bin
🎯| 14.81s | ↙ build-lib-types
🎯| 0.71s | ↙ build-site-twizzle
🎯| 2.47s | ↙ build-site-experiments
🎯| 0.11s | ↙ build-sites
🎯| 8.28s | ↙ build-site-docs
🎯| 0.00s | ↙ test-build
🎯| 2.20s | ↙ test-dist-lib-node-import
🎯| 10.90s | ↙ test-dist-lib-node-scramble-all-events
🎯| 2.19s | ↙ test-dist-lib-perf
🎯| 2.19s | ↙ test-dist-lib-plain-esbuild-compat
🎯| 2.19s | ↙ test-dist-lib-build-size
🎯| 1.00s | ↙ test-dist-sites-experiments
🎯| 0.00s | ↙ test-dist-lib
🎯| 2.30s | ↙ test-dist-bin-shebang
🎯| 2.30s | ↙ test-dist-bin-npm-exec
🎯| 0.01s | ↙ test-dist-bin
🎯| 0.00s | ↙ test-dist
🎯| 0.01s | test-all
from indicatif.
- I'd prefer to avoid making it configurable/opt-in, but making it good (enough) for everyone instead.
- Would probably be nice to add milliseconds to
_precise
, too. - Yes, I agree that might make more sense. Maybe do
0.2f
for values less than 2s?
from indicatif.
Related Issues (20)
- Pressing key during progress bar causes rerender HOT 2
- Spinner not spinning HOT 5
- Bug: Progress Bar not showing while using `wrap_write` HOT 2
- Odd behavior when `ProgressBar::println`ing lengthy messages HOT 2
- bug: `MultiProgress` with `insert_before` and `suspend` destroys the previous progress bars HOT 9
- Document behavior of `MultiProgress`, `suspend`, and `ProgressBar` scopes
- Built-in support for OSC9;4 HOT 2
- per_sec values not retained when iteration exits early with ProgressFinish::Abandon HOT 2
- `attempt to add with overflow` when using MultiProgress with hidden target HOT 2
- How to get the message content in memory HOT 2
- Empty lines in `MultiProgress::println` leads to lost output HOT 4
- Progress Bars over 80 characters move up the screen when stdout is redirected HOT 4
- Feature request: `per_it` template key HOT 1
- Width-filling progress bars wrap around on >1 character wide emojis HOT 3
- indicatif crashes with assertion failed: self.orphan_lines_count <= self.lines.len() if number of terminal columns is less than 135 HOT 11
- Finished progress bars are not preserved in `MultiProgress::println` HOT 6
- `{msg}` `.set_message(Cow<'static, str>)` design unnecessarily requires allocation HOT 3
- Question: How to get latest progress bar state string HOT 3
- Git repo is missing tag for v0.17.7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from indicatif.