<quote who="Howard Lowndes">

> I have a need to output a progress counter from a PHP script that takes a
> while to run whilst writing a large number of records out to an SQL
> database, mainly so that the user knows that things are still happening
> and not hung.
> 
> It seems a simple thing to do, but when I try it, the progress counter
> (say, every 100 records) instead of being output at the correct time, gets
> delayed until the whole process has finished.
> 
> What is the best way to get around this problem.

flush() liberally. :-) You might want to do it every loop, or every five or
so depending on what kind of performance:visibility ratio you're aiming for.

- Jeff

-- 
GUADEC 2008: Istanbul, Turkey                         http://www.guadec.org/
 
                   No match for "LINUSWEARSTHEPANTS.ORG".
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to