3 ms·
$('.readyButton').click(); setTimeout(()=> [...document.querySelectorAll('input[type="checkbox"]')].map(cb => cb.click()), 3000) This gives me 0.143 in Safari
by msoad 4y ago
$('.readyButton').click(); setTimeout(()=> [...document.querySelectorAll('input[type="checkbox"]')].map(cb => cb.click()), 3000)
This gives me 0.143 in Safari which is just a proof that DOM is freaking slow haha!
- alarmingfox 4y agoWow in Chrome 102.0.5005.115 (Official Build) (arm64) it gives me 3.273s which proves that point even more
- lauriswtf 4y agoHopefully you forgot to exclude 3sec timeout from that
- drudoo 4y agoI got 0.087 with firefox but subsequent tries are all in the 0.3-0.8 range.
- martini333 4y ago0.012 in Edge
- bduffany 4y agoI wonder how much of the time is spent in the onclick handler. Each of those clicks has to wait for the onclick handler before the next one executes, IIUC?
- eloox 4y agosetTimeout doesn't guarantee that it will execute exactly after 3000. (() => { const targ = $(".setGo"); const targ2 = $(".theSport > div:nth-child(2)"); const observer = new MutationObserver((mutations, observer) => { if (mutations[0]?.target?.classList.contains('going')) { targ2.childNodes.forEach(c => c.click()); } }); observer.observe(targ, { subtree: false, attributes: true }); $('.readyButton').click() })(); This gives me consistent Time: 0.001 in FF. "Time: not yet set" in Edge/Chrome.
- msoad 4y agoToday I learned. Thank you!