News for hackers. Stuff that matters.
Re:Checkbox Olympics by msoad on Tuesday June 21, 2022 @07:10AM (#31822562)

     $('.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!
Re:Checkbox Olympics by eloox on Tuesday June 21, 2022 @10:01AM (#31824044)
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.
Re:Checkbox Olympics by msoad on Tuesday June 21, 2022 @03:04PM (#31827778)
Today I learned. Thank you!
Re:Checkbox Olympics by alarmingfox on Tuesday June 21, 2022 @07:44AM (#31822790)
Wow in Chrome 102.0.5005.115 (Official Build) (arm64) it gives me 3.273s which proves that point even more
Re:Checkbox Olympics by lauriswtf on Tuesday June 21, 2022 @07:54AM (#31822846)
Hopefully you forgot to exclude 3sec timeout from that
Re:Checkbox Olympics by drudoo on Tuesday June 21, 2022 @07:56AM (#31822861)
I got 0.087 with firefox but subsequent tries are all in the 0.3-0.8 range.
Re:Checkbox Olympics by bduffany on Tuesday June 21, 2022 @09:26AM (#31823675)
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?
Re:Checkbox Olympics by martini333 on Tuesday June 21, 2022 @08:12AM (#31822951)
0.012 in Edge