Вопрос

I have compiled SpiderMonkey from source and i try to measure Execution times of some functions . When i run the code inside Firefox browser using Scratchpad or plain Console session i have tools like : console.time() , console.timeEnd() , and performance.now() . This works fine for me , but when i run the code inside SpiderMonkey engine i dont have those tools available , Using Date() does not give precise results .

What tools are available inside SpiderMonkey for this type of scenarios ?

Это было полезно?

Решение

There's dateNow() function, and there's also PerfMeasurement object (don't mind the mentions of the jsm code module, the API is directly available in the shell, although only on Linux at the moment).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top