In general, there is a site promotion. Users add tasks, for example, subscribe to Andrey, or like a record, and others perform these tasks. So, yesterday I decided to write a bot that will perform tasks for you. In PHP and JS. Only 2 queries are added to the database. Changes in the job counter and the charging of coins to the user. The delay is 20 seconds. That is, a request is sent to the server every 20 seconds. Delay view:
setTimeout(function() { _bot._reload(); }, 20000);
They began to use a lot of the bot, but to change the delay by 1 second, for example, and thus, arrange a self-hostess site. So I wanted to ask. There is such a function sleep () , set sleep (20), and setTimeout naturally removed. And it just became so slow to load everything so that the site was completely out of reach. Why does sleep (20) work such wonders?