04 February 2008

JavaScript Profiling with Firebug + Firefox

I'm sure you're already using Firefox and Firebug to debug and help code your JavaScript. (If not, seriously, why? Get it here and here, you silly person, you.)

Want to see something that will blow just blow your mind and that I, a Firebug user for more than a year, just figured out today?

Put "console.profile()" at the start of a block of your code and "console.profileEnd()" at the end of it.

Then load the page in Firefox (with Firebug, of course).

Yeah... neat ain't it. It's a complete listing of every single JavaScript call that was done between the two little bits of code that you added.

I just fucking found out about this.

No comments:

Post a Comment