YUI Library Examples: ProfilerViewer Control (beta): Simple Profiling

ProfilerViewer Control (beta): Simple Profiling

In this simple example, the ProfilerViewer Control is used to profile an instance of the YUI Calendar Control. Interact with the calendar interface, then activate the ProfilerViewer to see the profile data. You can then continue to interact with the calendar, refreshing the data in the ProfilerViewer to update the profiling display.

A Simple Use Case: Profiling Calendar

One of the nice things about the YUI Profiler is that it makes it simple to profile any JavaScript function or object structure. ProfilerViewer's job is to make it just as easy to explore that data.

In this example, we create an instance of YUI's Calendar Control, tell Profiler to profile our Calendar instance, and then use ProfilerViewer to experience that data.

This example has the following dependencies:

We begin with empty div elements for Calendar and Profiler to use:

In JavaScript, we instantiate our Calendar and then pass the instance to Profiler for profiling:

Finally, we set up ProfilerViewer to consume the profiling information and make it visible in the interface:

The full JavaScript block for this example is as follows:

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings