Perl: the Markov chain saw | |
PerlMonks |
Re^5: timer without modulesby Random_Walk (Prior) |
on Nov 09, 2009 at 15:27 UTC ( [id://805945]=note: print w/replies, xml ) | Need Help?? |
time() returns the number of seconds since the epoch. When your function is called check if the value from time() is greater than the previous stored value + 60 seconds. If there is no previous value 0|undef + 60 will certainly be less than time() returns. your problem may be more with deciding which data structure you want to use to store these time stamps for each user. A global hash keyed on user name would be the simplest if a little cludgy. Cheers,
Pereant, qui ante nos nostra dixerunt!
In Section
Seekers of Perl Wisdom
|
|