Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: perl program statusby Lexicon (Chaplain) |
on Apr 05, 2001 at 04:42 UTC ( [id://69961]=note: print w/replies, xml ) | Need Help?? |
I think I have a different take on what you're after than everyone else. I've written a few jobs that take an hour or so to finish, and I want to know that they're proceeding along smoothly. This is also pretty standard for debugging things in the first place, so if you set this up first it will help with your debugging and give you status afterwards. I assume you're doing everything at the command line and not TK or anything... First, build a standard subroutine to do all your output for you. Mine follows. It prints my status messages where I want them as well as the message index, the time, and the elapsed time. Before every major section, Log what you are about to do. Give the message a nice bold start so you know you're at a major heading. If you are processing and you want status of the processing, put an if statement in your loop and print some status every 1000 iterations or whatever is apropriate. If it's really heavy processing, the single if shouldn't slow you down too much, especially if you're calling subroutines, at least if Fundamental Benchmarks has any validity. Put some dashes in front of the message so you know you're in a subsection. I also like to throw in some extra processing to give me an Estimated Time To Completion. I have never ever seen this value be very accurate, as programs tend to slow down after a while of heavy processing. But I do it anyway. Hope this helps!
In Section
Seekers of Perl Wisdom
|
|