lose the pause, and print the progress indicator at the bottom of the for loop. If that's too fast, keep a counter and print only on every Nth pass through the loop. You don't get a nice steady progression (assuming that the conversions are not equally lengthy), but you do get something that is at least a little bit useful. If you can figure out how, print outside of the loop, then print spinner[i] where spinner is an array of these characters: |/-\
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
I'm absolutely not a windows guy, but I've seen progress bars on installation tools that have to be running in parallel to the installation (I guess). How about at the top of the loop you fire off a little window with a spinner or barberpole or something and a (guess) as the to time remaining. Make it big, but count it down. Then if there is still some time remaining when you get to the bottom of the loop and close it, people are happy. If it sits there with negative time remaining, people worry.
Now: "Fire off a little window" is all you have to figure out how to do, eh? Yeah, you could minimize the command window, if you can figure out how. Maybe if you wrap the whole thing in a GUI, then you can just draw the count-down over the top of it?
If the conversion process has a loop in it somewhere, you could send some information back at the bottom of that loop to use for a count-down graphic. I'm just muttering and waving my hands here...
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256
If each file is taking up to 30 minutes, and you have lots of files, then the total run time is going to be many hours, possibly an overnight job, or even days.
Why do you need a per-second update of progress?
Or why do you have so much "free" time to care about looking at the progress so often of a process which is going to take a long time.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
It may be more trouble than its worth.
The sign of an intelligent IT person ;)
From time to time, I've found myself writing a variant on this:
At the top of every loop,
print <<the description of what will be handled>>
<<calculate the finish time?>>
print %currenttime%
print "******"
print "THIS WILL TAKE ABOUT 30 minutes <<and finish at approximately %finishtime%>>
print "******"
print ""
print "--------------------------------"
print "!!! DO NOT CLOSE THIS WINDOW !!!"
print "--------------------------------"
print ""
print "******"
At the bottom of every loop, print the description of what was just handled
At the end of the program,
print ""
print "OK, we're done now. Thanks for your patience"
print ""
griswolf
Veteran Poster
1,165 posts since Apr 2010
Reputation Points: 344
Solved Threads: 256