Game Development Reference
In-Depth Information
Now, let's use the
Profile Profile Project (InvinciBagel)
work process one final
time to see if anything new has appeared in the
Live Results
and
Threads
tabs in
NetBeans. Click the Live Results icon, shown at the left of
Figure 7-21
,
and start the
Live Results Profiler in a tab. Note that the GamePlayLoop object is created, using <in-
it>; that an AnimationTimer is started, using the
invincibagel.GamePlayLoop.start()
entry in the Profiler output; and that there is an
invinciba-
gel.GamePlayLoop.handle(long)
entry as well, which means that your game timing
loop is being processed.
Figure 7-21
.
Run the Live Results Profiler
As you can see, the
Invocations
column indicates how many pulses have accessed
the .handle() method in the GamePlayLoop. It has only taken
40.1
milliseconds to pro-
cess
3,532
pulses, so each pulse equates to
0.0114
milliseconds, or
114
nanoseconds,
using the new Java 8 timing resolution. Thus, your current code for testing the pulse, or
at least the JavaFX pulse engine, is running efficiently.
Of course, you will need to remove this pulse engine testing code from the
.handle() method before moving on to the next chapter, when you will start processing
game assets and logic inside this method.
Next, let's scroll down one last time in the Profiler tab, displayed at the top left of
Figure 7-21
,
and click the
Threads
icon, which is shown at the top left of
Figure 7-22
,
to open the Threads tab. As you can see, the pulse engine is running, and pulse events
can be seen processing in Thread-6 as well as the JavaFX Application Thread.