Giter Club home page Giter Club logo

java-progressbar's Introduction

ProgressBar

This is a simple console progressbar for Java. It can be used in CLI programs to display progress for long tasks.

It was born because I could not find a simple progress bar implementation for console based Java applications.

The inspiration came from visionmedia's node-progress.

Build Status

Usage

ProgressBar progressBar = ConsoleProgressBar.on(System.out);
progressBar.tickOne();
// do something
progressBar.tick(25); // this will increase the percentage to 26
// do the rest
progerssBar.finish(); // this will finish it

Example output

[==================================--------------------------]  57.00% 393ms

Advanced configuration

ProgressBar progressBar = ConsoleProgressBar.on(System.out)
    .withFormat("[:bar] :percent% :elapsed/:total ETA: :eta")
    .withTotalSteps(500);

Available replacers for format

  • :bar the progress bar
  • :elapsed the elapsed time since the start() or the first tick()
  • :percent the percentage without the percent sign
  • :eta the estimated time to accomplish
  • :total the total time to complete

TODOs

  • it does not check whether the progressbar has been finished or not, so don't call finish() more than once

java-progressbar's People

Contributors

raszi avatar

Watchers

James Cloos avatar  avatar

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.