# Exercise Four: Collecting Profile Data

This exercise shows you how to run the Blink project with the Java WorkShop profiler. The profiler helps you analyze the performance of your program to determine how much time is spent in each of the program's methods and how many times each of the methods are executed.

1. Check the project manager for the name of the current project.
   If the current project is not Blink, double-click on the Blink project name.
2. Start profiling the Blink project by clicking the Profile button on the Java WorkShop main toolbar.
   The Applet Viewer window is displayed.
3. Wait at least 45 seconds before going on to the next step.
This provides enough data to produce a useful profiling display.
4. End the profiling session by choosing Applet -> Quit, in the applet viewer.
   After profiling the program, the Profiler window displays the data written to the project source directory's `Blink.prof` file.
5. In the Profiler window, choose Filter -> None to display the system class data.
6. Choose View -> Sort by Name to display the method data in alphabetical order.
7. Select the `Blink.paint (Ljava/awt/Graphics;)` method.
8. Review the profile data, with results similar to the figure below:

The results indicate that:

- Java WorkShop spent 93 milliseconds calling the `Blink.paint (Ljava/awt/Graphics;)` method.
- `Blink.paint (Ljava/awt/Graphics;)` calls three methods: `java.awt.Color. (III)`, `java.awt.Component.size ()`, and `java.awt.Font.getSize ()`.
- The two methods that call the `Blink.paint (Ljava/awt/Graphics;)` method are: `java.awt.Component.dispatchEventImpl (Ljava/awt/AWTEvent;)` and `java.awt.Component.update (Ljava/awt/Graphics;)`.

Next lesson:

  You have completed the lessons in this tutorial. The next tutorial is Tutorial Two: Editing Project Attributes.