I have to run a piece of code at randomly chosen times but I have to run it about once a day for instance. The program is not running all time so I can't really force it to run every hour and do something like if rand(1..24) == 1
How can I manage to have this kind of frequency without running it all time ?