in reply to Re^4: timer without modules
in thread timer without modules
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,
R.
Pereant, qui ante nos nostra dixerunt!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: timer without modules
by elunatic (Initiate) on Nov 09, 2009 at 21:37 UTC | |
by Random_Walk (Prior) on Nov 10, 2009 at 14:26 UTC |
In Section
Seekers of Perl Wisdom