@@ -50,15 +50,16 @@ you can also set the current progress by calling the
50
50
51
51
If your platform doesn't support ANSI codes, updates to the progress
52
52
bar are added as new lines. To prevent the output from being flooded,
53
- use the method :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::preventRedrawFasterThan `
54
- (it writes to the output after every N seconds) and the method
53
+ use the method :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::minSecondsBetweenRedraws `
54
+ to limit the number of redraws and the method
55
55
:method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::setRedrawFrequency `
56
- (it writes to the output every N iterations) . By default, redraw frequency is
56
+ to redraw every N iterations. By default, redraw frequency is
57
57
**100ms ** or **10% ** of your ``max ``.
58
58
59
59
.. versionadded :: 4.4
60
60
61
- The ``preventRedrawFasterThan() `` method was introduced in Symfony 4.4.
61
+ The ``minSecondsBetweenRedraws() `` and ``maxSecondsBetweenRedraws() ``
62
+ methods were introduced in Symfony 4.4.
62
63
63
64
If you don't know the exact number of steps in advance, set it to a reasonable
64
65
value and then call the ``setMaxSteps() `` method to update it as needed::
@@ -295,19 +296,18 @@ to display it can be customized::
295
296
.. caution ::
296
297
297
298
For performance reasons, Symfony redraws screen every 100ms. If this is too
298
- fast or to slow for your application, use these methods:
299
- :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::preventRedrawFasterThan `
300
- :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::setRedrawFrequency `
301
- :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::forceRedrawSlowerThan `::
299
+ fast or to slow for your application, use the methods
300
+ :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::minSecondsBetweenRedraws ` and
301
+ :method: `Symfony\\ Component\\ Console\\ Helper\\ ProgressBar::maxSecondsBetweenRedraws `::
302
302
303
303
$progressBar = new ProgressBar($output, 50000);
304
304
$progressBar->start();
305
305
306
306
// this redraws the screen every 100 iterations, but sets additional limits:
307
- // don't redraw slower than 100ms (0.1 ) or faster than 200ms (0.2 )
307
+ // don't redraw slower than 200ms (0.2 ) or faster than 100ms (0.1 )
308
308
$progressBar->setRedrawFrequency(100);
309
- $progressBar->forceRedrawSlowerThan (0.2);
310
- $progressBar->preventRedrawFasterThan (0.1);
309
+ $progressBar->maxSecondsBetweenRedraws (0.2);
310
+ $progressBar->minSecondsBetweenRedraws (0.1);
311
311
312
312
$i = 0;
313
313
while ($i++ < 50000) {
@@ -318,7 +318,7 @@ to display it can be customized::
318
318
319
319
.. versionadded :: 4.4
320
320
321
- The ``forceRedrawSlowerThan `` and ``preventRedrawFasterThan () `` methods
321
+ The ``minSecondsBetweenRedraws `` and ``maxSecondsBetweenRedraws () `` methods
322
322
were introduced in Symfony 4.4.
323
323
324
324
Custom Placeholders
0 commit comments