The “Clock”

The RTSJ supports the notion of multiple clocks. It is not obvious why a system would want more than one clock. In fact, systems with multiple clocks often go to great pains to get the effect of a single clock. If there are multiple clocks and that fact is visible to software, you have to know which clock is associated with any given time and you have to take great care never to compare times that are associated with different clocks.

Pick one good clock and stick with it unless hardware restrictions force you to use multiple clocks.

Here are some excuses for making multiple clocks visible to the Java runtime:

  • Battery-backed clocks that keep calendar time whether the system is on or off are slow to read or write and seldom generate ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.