views:

590

answers:

1

In Safari 4, I am trying to use the profiler to see how the time is spent in the code that runs when the page loads.

  1. I enabled the profiler ("Start profiling JavaScript")
  2. I load the page.
  3. I stop the profiler.

At this point, this doesn't create a "profile" snapshot (while it does if I start the profiler after the page is loaded). Any hint on this?

+3  A: 

For code inside onLoad handlers, you need to enable the profiler programmatically. Add console.profile() to the start of the relevant javascript, and console.profileEnd() to the end.

Read more here: Using the Web Inspector

It's very similar to FireBug's profiler: Console API

jeffContext
@jeffContext Fantastic; works great. Thank you!
Alessandro Vernet