Hacker News new | past | comments | ask | show | jobs | submit login

     $('.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!



setTimeout 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.


Today I learned. Thank you!


Wow in Chrome 102.0.5005.115 (Official Build) (arm64) it gives me 3.273s which proves that point even more


Hopefully you forgot to exclude 3sec timeout from that


I got 0.087 with firefox but subsequent tries are all in the 0.3-0.8 range.


I 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?


0.012 in Edge




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: