Skip to content

Instantly share code, notes, and snippets.

@robcee
Created February 17, 2014 23:16
Show Gist options
  • Save robcee/9061250 to your computer and use it in GitHub Desktop.
Save robcee/9061250 to your computer and use it in GitHub Desktop.
// open a web console
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
// console.profile();
let targét = devtools.TargetFactory.forTab(gBrowser.selectedTab);
let startTime = Date.now();
let endTime;
gDevTools.showToolbox(targét, "inspector").then(() => {
endTime = Date.now();
});
// need to wait for endTime to resolve
endTime - startTime
let startTime2 = Date.now();
let endTime2 = undefined;
gDevTools.closeToolbox(targét).then(() => {endTime2 = Date.now()});
// need to wait for endTime2 to resolve
endTime2 - startTime2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment