Hello ๐
I'm Prakhar, a software engineer working on Firebase at Google! I live in San Francisco and love building awesome tools for developers. To know more about me visit my website.
Thanks for stopping by!
A flexible ASCII progress-bar for C++
License: MIT License
I'm Prakhar, a software engineer working on Firebase at Google! I live in San Francisco and love building awesome tools for developers. To know more about me visit my website.
Thanks for stopping by!
Right now I'm working on a ray tracer and I thought it would be a nice touch to add in a progress bar on the command line. This looked simple enough so I grabbed. But after putting in, it's use drastically slowed down the render times. For example, I'm trying to render a 960x540 image (and about 10 samples per pixel).
ProgressBar(540, ...)
) and incremented it after completing a row of pixels, it took on average it took 3.8 seconds to complete a renderProgressBar(960 * 540, ...)
) and increment after completing a single pixel, it took an average of 21 seconds (!!)After taking a look in the display()
code, I think the cause is all of the IO to standard output. There should be some better way to build the string that needs to be printed. I.e. buffer the output string. I can try to provide a solution to this if you'd like me to, but it might be a bit before I get around to it.
Hello,
this is actually not an issue, just a suggestion.
what about ship it with a c++ pakage manager, like for example conan?
Cheers.
Great header lib. The comments in your example do not line up to the actual functionality.
Hey,
I tried nesting multiple progressbars like in this example:
#include <iostream>
#include "progressbar.hpp"
int main()
{
ProgressBar pb1(100, 70);
for (int i = 0; i < 100; ++i) {
pb1.display();
++pb1;
// Do additional stuff
ProgressBar pb2(100, 70);
for (int j = 0; j < 100; ++j) {
pb2.display();
++pb2;
// Do additional stuff
}
pb2.done();
}
pb1.done();
return 0;
}
Unfortunately, this does not work. Instead the first progressbar disappears as soon as the second one gets displayed for the first time. After the second bar is finished, the first bar appears only for a brief moment, updates once, and disappears again.
Is there a way to nest two progressbars using the current implementation?
PS: If you want to run the example code, I recommend putting some sleep()/uslepp() in there, otherwise it will run too fast to notice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.