var a= {b:function(){},c:function (){}};
a.c();
console.profileEnd();

The console.profile and profileEnd calls are part of the Firebug panel and will start and stop the profiler respectively.

What you should get from this is a report of time spent in the c() function. Instead, you'll be told that time was spent in the b() function, since it's the first function declared in the object literal.

You're most likely to run into this problem profiling compressed code which would happen if you, say, were using the compressed version of a particular JavaScript library. Obviously, my advice is to use uncompressed code, even for popular JavaScript libraries.

Published May 31, 2007
Categorized as JavaScript
Short URL: http://www.avmdanse.com/s/810

Conversation

5 Comments · RSS feed
Delilah Hinman said on May 31, 2007

I definitely think you should write a post about the profile feature.

Emil said on June 01, 2007

Yes that would be appreciated

Matthew Pennell said on June 01, 2007

If not here, then somewhere else... ;)

Cory Duncan said on June 01, 2007

Agreed. A podcast would be even better :)

Ara Pehlivanian said on June 02, 2007

The profiler is so sweet. It saved my butt and helped me shave 4-6 seconds off of a front page's load time by identifying a hog of a function that occupied 80% of the overall render time.

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.
f2富二代官网入口