プログラムで次のことを実行できるようにするいくつかのクロムAPI(クロム拡張で使用される)を探しています:--プロファイリングを開始します-プロファイリングを終了します-ページ上のすべてのJSにかかった時間のリストを取得します
私はFirefoxで次のように同じことを達成できます:
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
}
開発者ツールバーからプロファイリング情報をエクスポートできる API も役立ちます