Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

It so much depends on the precision of the job. Is it paramount to finish on time? Is the job to stop in-process when time is running out? Or is it rather unimportant?

Imagine your boss is coming round telling you to manually stamp envelopes for the next two hours. No reprogramming any printers, hands off the keyboard. Take that stamp and stamp away.

So you stamp an envelope each and then look at the clock or your watch, check the two hours haven't passed yet and proceed?

Or you absentmindedly stamp away, always fixing the clock with your eyes and let the stamp fly out of your hands when time's finally out?

In programming, you could calculate the time when to stop, create a sub stampit and a loop checking for the time out to be reached around calling that subroutine... in the first place. In the second, also check for the time inside the stamping routine and when time's out, leave it (i.e. return to end the loop) with the last; command.

Cheers, Sören

Créateur des bugs mobiles - let loose once, run everywhere.
(hooked on the Perl Programming language)


In reply to Re: Perl script to run for x hours by Happy-the-monk
in thread Perl script to run for x hours by t-rex

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 imbibing at the Monastery: (7)
As of 2024-04-24 10:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found