Skip to content

[Console][ProgressHelper] new feature: I think it would be nice to have a estimated time left counter #9560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lsv opened this issue Nov 21, 2013 · 5 comments

Comments

@lsv
Copy link

lsv commented Nov 21, 2013

Fx.

$progress->start($output, 5000);
for($i = 0; $i < 5000; $i++) {
   sleep(5);
   $progress->advance();
}

When the progress has counted the first 2-3 elements it would be nice to have a estimated time left after the percent in the console.

 62/5000 [====>---------------------]  63% 1h20min
@stof
Copy link
Member

stof commented Nov 21, 2013

how could we estimate the time left ?

@GromNaN
Copy link
Member

GromNaN commented Nov 21, 2013

👍
We use this kind of progress bar in our projects.

[=========>                     ] 32% (281/890) [ remaining: 6 min 47 sec | elapsed: 3 min 8 sec ] (memory: 85.25MB)

To estimate the time remaining, it's only : time elapsed * remaining elements / processed elements.
The code is here:
https://github.com/LExpress/symfony1/blob/master/lib/task/sfBaseTask.class.php#L447-L518

@jeroenvisser101
Copy link

This would actually be pretty great, but for what would be using this?

@wouterj
Copy link
Member

wouterj commented Nov 21, 2013

This should be an optional option to do this. Not every progress executes the same steps over and over again.

@lsv
Copy link
Author

lsv commented Nov 22, 2013

I have made the changes to pull request #9572

So the I am closing this and continuing in #9572

@lsv lsv closed this as completed Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants