Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How long 'tween now and then?

by chromatic (Archbishop)
on Sep 13, 2000 at 04:02 UTC ( #32215=note: print w/replies, xml ) Need Help??


in reply to How long 'tween now and then?

If you can keep a tiny little data file around, you only need to figure out the epoch seconds for one invocation of the script. Just add (60 * 60 * 24) seconds to it once a day, and generate the new sleep value with a simple subtraction statement.

I'd do something like:

# run operation # get timestamp from file # add 60 * 60 * 24 to it # write new timestamp to file # subtract current seconds from timestamp # sleep for result seconds

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://32215]
help
Chatterbox?
[Corion]: Weird. HTML::Selector:: XPath is on v0.22 on search.cpan.org but v0.20 on metacpan.org - I wonder what part of the pipeline I have to kick; most likely the metacpan indexer...
[LanX]: ♪..♫ I shot pmdev, but I didn't shoot no janitor ...♩..♬

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2017-03-23 13:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (286 votes). Check out past polls.