Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Time modules

by Marshall (Canon)
on Feb 24, 2009 at 21:52 UTC ( [id://746117]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Time modules
in thread Time modules

Beth is on it!

I would add that be careful as any kind of user display is a VERY expensive operation - more expensive than even opening a file.

I usually put a thin layer that counts N units of work. This is called after every work unit. When N units are reached (or time window, etc), this routine calls the UI. The main point here is that the UI is SLOW. If say you are doing 10,000 things and have a progress bar with 0-100%, there will be a HUGE performance difference between just calling that UI 100 times vs 10,000 times! If your program makes progress very quickly, do a test case just to see how fast the progress can go from 0% to 100% without doing any "real" work. You will be amazed. In this type of case, the CPU power required to calculate the time since last display will be dwarfed by the CPU power required to actually display something. This is true on command line as well as GUI. Some folks think that command line display is fast, but that is not true. In some cases this can be even slower than a GUI display.

I hate this Microsoft file copy display. It it just a picture and is a separate process unrelated to the actual work being done. If you have a choice, always display something that is related to the amount of work that has been done, not just a "I am working" message.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://746117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found