Answer the question
In order to leave comments, you need to log in
How to test script execution speed?
Maybe someone knows the most convenient way to test the speed of script execution.
Need to explore a couple of scripts without a website.
Answer the question
In order to leave comments, you need to log in
- Раставить счетчики «руками» `new Date().getTime()`, `Date.now()` или `performance.now()`;
- console.time
- console.profile
- https://benchmarkjs.com/
- https://jsperf.com/ или https://jsbench.github.io/
It seems that developer tools in browsers have such a feature.
The easiest way is to create a new date at the beginning of the script and then a new date at the end of the script. Subtract the first from the second and get the execution speed in milliseconds. https://yutex.ru/knowledgebase.html?article=85
Or you can use decorators for functions learn.javascript.ru/decorators
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question