Loop Countdown Timer

Been trying to implement a countdown timer for awhile.

Here's what I have. A do loop that goes through a recordset of approx 250000 records and performs updates on each.  Takes quite some time, around 20 minutes.  I am using a progress bar to view it run, but would be a little more userful if I had a way to display the approximate time remaining to run through the entire loop.

I know this involves some use of the timer, but can't really get a handle on how this would work.  

VB 6 code that works gets 500 pts ... thanks!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimCotteeHead of Software ServicesCommented:
Hi pmusser-dup,

Don't really need to use a timer at all, if you are using a progress bar then presumably you know a) the number of records to process and b) the current record processed.

If so then you should store the date/time the process starts to a variable and then using DateDiff("s",StartDateTime,Now()) to get the elapsed time.

Work out how many records have been processed, divide this into the number of seconds taken and then multiply by the number of records left to process. This gives you an estimated number of seconds left to complete the process.

Tim Cottee

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.