문제

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