GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - raszi/java-progressbar: ProgressBar

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
gradle/wrapper
gradle/wrapper
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 
testng.xml
testng.xml
 
 

Repository files navigation

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.

CI Maven Central

<dependency>
  <groupId>hu.ssh</groupId>
  <artifactId>java-progressbar</artifactId>
  <version>0.1.0</version>
</dependency>

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

About

ProgressBar

Resources

Readme
MIT license
Activity

Stars

47 stars

Watchers

4 watching

Forks

18 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.