Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Module to calculate ETA

I have a task that I'm solving. There is a web page that shows the progress of some long lasting process. The process consists of bunch of small tasks. I need to calculate estimated time of process accomplishment.

This sound pretty easy. I have start time, I know the number of small tasks that would be done. After complition each small task I can use the simple formula to calculate ETA:

estimated_time = number_of_tasks_left * ( ( current_time - start_time ) / number_of_tasks_done )

But I can't imagine that I'm the first who needs such a thing. I've tried to find CPAN module that can solve this kind of problem, but I found noting.

Actually there is a great module Term::ProgressBar that calculated ETA. I use this module in my console scripts and I'm supper happy with it, but I need to calculate ETA and output it on a web page, and for this task this module doesn't suit.

Actually I have written a draft of module Time::ETA that will solve my problem (you can see the working example). But I can't believe that there is no module for this purpose on CPAN.

My question is there some CPAN module that can help me solve my task, or I should complete Time::ETA and upload it to CPAN?

UPDATE: I've created and released module Time::ETA


In reply to Module to calculate ETA by bessarabov

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (11)
    As of 2015-07-07 13:22 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (88 votes), past polls