Progress bar in drupal admin area for long running scripts
Grab a copy of Examples and checkout the batch_example module. 

It's got several code examples for various scenarios using the batch API, which Drupal uses internally to produce pages with progress bars (like the upgrade check page for example). The module is very well commented, and it should give you everything you need to get started.