Skip to content

Throttling

bjmfactory edited this page Nov 18, 2014 · 1 revision

When reporting progress of large amounts of very fast operations, whose duration is comparable to the output time of a progress bar, it becomes desirable to throttle output to the console and only perform it once in a set period. ProgressBar supports throttling if given :throttle_rate option:

ProgressBar.create(:throttle_rate => 0.1)

The above progress bar will output at most 10 times a second.

The default throttling rate is 100 times per second (or 0.01)