Skip Menu |

This queue is for tickets about the Term-Activity CPAN distribution.

Report information
The Basics
Id: 18223
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Term-Activity

People
Owner: bennie [...] cpan.org
Requestors: vlad [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.06
Fixed in: 1.14



Subject: No progress bar when "sleep 1" is inside the cycle
No progress bar output: #!/usr/bin/perl use Term::Activity; $|=1; my $ta = new Term::Activity ({ debug => 1 }); $c = 0; while (1) { $ta->tick; sleep 1; $c++; last if $c > 100000; Term-Activity-1.06]$ perl ex1 DEBUG: Intializing skin: wave (_ants_wave) DEBUG: Starting count : 0 DEBUG: Starting size : 80 DEBUG: Starting interval : 100 DEBUG: Starting time : 1142627168 DEBUG: Starting last time : 1142627168 DEBUG: tick() count: 1 interval: 100 DEBUG: tick() count: 2 interval: 100 DEBUG: tick() count: 3 interval: 100 DEBUG: tick() count: 4 interval: 100 DEBUG: tick() count: 5 interval: 100 DEBUG: tick() count: 6 interval: 100
Wow. Somehow I lost track of this bug. Oh well. Replying 8 years later... So here is what is happening: This is a side effect of the starting interval being 100 units. "Interval" as shown in your debug output, is how many tick()s must be called before the screen is updated. (If screen output happened on reach tick(), very fast processes would be slowed down considerably. The module has no way of knowing what speed it will be called at initially and a default of 100 iterations was coded in the original module. It then adjusts its speed on each screen update. The good news: I've already fixed this in version 1.14. You can now manipulate the interval to your hearts content and the POD discusses using this module with "slower" processes: my $ta = new Term::Activity ({ interval => 1 });