Lighthouse shows a warning when JavaScript execution takes longer than 2 seconds. The audit fails when execution takes longer than 3.5 seconds:
To help you identify the biggest contributors to execution time, Lighthouse reports the time spent executing, evaluating, and parsing each JavaScript file that your page loads.
See the Lighthouse performance scoring post to learn how your page's overall performance score is calculated.
For other ways to improve page load, check out the Performance audits landing page.
Source code for Reduce JavaScript execution time audit