Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Show information before end of script

by schweini (Friar)
on Sep 15, 2005 at 23:46 UTC ( #492469=note: print w/replies, xml ) Need Help??


in reply to Show information before end of script

what i do in long report-generating scripts is to send a
<script> updateProgressbar( $percentCompleted ) </script>

to the browser from inside the loop that's doing the computation. Obviously, i define function updateProgressbar(percent) in some globally included .js file.
Works great for me, but just be careful not to send something like this on every iteration of a fast-iterating loop, since you could easily clog even broadband connections with millions of these instructions. i usually do something like
&printProgessJavascript( %percent ) if ($i++ % 1000 == 0);

on the perl side.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://492469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2020-04-09 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (47 votes). Check out past polls.

    Notices?