Also, how does he guarantee his function to be called at least once a day? Perhaps he needs a quantum machine to run his code or he should use a "predictable-random-generator" (http://goo.gl/jsYC) which "would violate his 'stateless' requirement".
Of course, you could also randomly generate a time, then sleep for that long. This gives you significantly more control (you can easily specify "wait at least an hour" or "wait at most 48 hours") and is less resource-intensive. (Of course, "wait at least an hour" is not a good idea if your program crashes all the time.)
6 comments
[ 2.3 ms ] story [ 22.7 ms ] threadIf you don't care how often your function runs then why not just rely on the system clock and maintain a "lastrun"-variable?
Still, nice.