The reactor's user interface provides a mechanism for reading back the current time, as given by the monotonic clock source. This may be interpreted as the current uptime of the reactor component, specified as an integer number of milliseconds using a Java native long integer. The API for accessing the current reactor uptime is illustrated in Listing 2.8.
The reactor's getUptime method may be called from any thread context in order to obtain the current uptime. An example of this method call in use is illustrated by the code fragment shown in Listing 2.9. This code fragment may be used to replace the delay introduced by the Thread.sleep call in the reactor lifecycle example of Listing 2.7. A full implementation of this example is included in the reactor examples package as ReactorUptimeExample.