How throttle and debounce timing functions can optimize your script performance