Why not just use setInterval?
let interval = setInterval(() => document.querySelector('.main-btn').click(), 50)
clearInterval(interval)
Why not just use setInterval?
Then to stop