Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The documentation is very confusing, but between reading the source code and rereading the docs, here's how it works:
  • min is the starting unit, e.g. 0
  • max is the ending unit, e.g. 100 or 1000
  • or in your case, maybe number of files or total number of Gb
  • report($format, $cur) - prints out how much has been done so far using the format $format. $cur is the number of units consumed so far, i.e. the number of files or number of Gb examined so far
  • time estimates are calculated by comparing the lapsed time to $cur/($max - $min) and scaling up appropriately.

So the usage would be something like:

  1. create a progress object with appropriate min/max
  2. in a loop,
    1. do N units of work
    2. after each N units have been completed, call report($format, $cur) to report how many units have been completed so far

BTW - I also noted the docs show report like this report(format, [current item]). I'm not quite sure what was intended by that. According to the source code, the call should look like this: report($format, $currentItem)

Best, beth


In reply to Re^3: Time modules by ELISHEVA
in thread Time modules by mikejones

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found