28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7 ■ The Foundation of Game Play Loop: The <strong>Java</strong>FX Pulse System and the Game Processing Architecture<br />

Figure 7-21. Run the Live Results Profiler<br />

As you can see, the Invocations column indicates how many pulses have accessed the .handle() method in<br />

the GamePlayLoop. It has only taken 40.1 milliseconds to process 3,532 pulses, so each pulse equates to 0.0114<br />

milliseconds, or 114 nanoseconds, using the new <strong>Java</strong> 8 timing resolution. Thus, your current code for testing the<br />

pulse, or at least the <strong>Java</strong>FX pulse engine, is running efficiently.<br />

Of course, you will need to remove this pulse engine testing code from the .handle() method before moving on to<br />

the next chapter, when you will start processing game assets and logic inside this method.<br />

Next, let’s scroll down one last time in the Profiler tab, displayed at the top left of Figure 7-21, and click the<br />

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<br />

is running, and pulse events can be seen processing in Thread-6 as well as the <strong>Java</strong>FX Application Thread.<br />

162<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!