Looking for some chrome API (to be used in chrome extension) that let me to do following programmatically:- - start profiling - end profiling - get list of time taken by all JS on the page
I can achieve the same in Firefox as:
jsd = DebuggerService.getService(jsdIDebuggerService)
// start the profiling as
jsd.flags |= COLLECT_PROFILE_DATA;
// stop the profilinf as
jsd.flags &= ~COLLECT_PROFILE_DATA;
// get the details of how much time each JS function took
jsd.enumerateScripts({enumerateScript: function(script)
{
// script object has timings detail
}
Even some API that can let me to export the profiling info from developer tool bar will be helpful
You can profile a script in google chrome programmatically using the following code
console.profile("MyProfile");
// Enter name of script here
console.profileEnd();
"MyProfile" is the name of the profile which will be created.
Source:
http://blog.codestars.eu/2011/profiling-with-webkit/
You could get the time for a function / code snippet to execute by using a combination of console.time()
and console.timeEnd()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With