Coder Social home page Coder Social logo

Comments (3)

djc avatar djc commented on September 2, 2024 1

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.

lgarron avatar lgarron commented on September 2, 2024

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" than 8s.

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.

djc avatar djc commented on September 2, 2024
  • 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.