Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Self invoking function that looped using setTimeout. Each 5 minutes it would do an ajax call or something. For some dumb reason I didn't use setInterval
-
orhun12495yI was never good at deciding the highest timeout. So I always do between 10sec and 1min but let me warn you, it's totally random.
-
Never set manually, but I had a Flash video chat app and it could flake out if you were connected for a while... People would have scheduled times to chat so if you got to the page early, it would use setTimeout to refresh the page when it was a few minutes before your time.
-
A friend of mine had that cookie clicker website open all the time and i set a timeout that would delete his cookies after day (but making a save before) or something. So yeah, probably 86400
-
I once made a kind of scheduler (like cron) in JS. It would load stuff from a file, so probably something like 86400*30. Of course i wouldn't have that kind of uptime so it only executed the last time it was loaded, which was probably a few days before that.
-
60*60*1.5*1000... Automated test suite ran roughly 1.5 hours and i wanted to create an alert for when it finished. I was stupid back then.
what's the maximum setTimeout function you've ever used? and for what reason?
question