Class DefaultTimingSource

  • All Implemented Interfaces:
    TimingSource

    public final class DefaultTimingSource
    extends Object
    implements TimingSource
    Default implementation for a TimingSource
    Since:
    4.1
    Author:
    Sanne Grinovero (C) 2012 Red Hat Inc.
    • Constructor Detail

      • DefaultTimingSource

        public DefaultTimingSource​(EngineThreads threads)
    • Method Detail

      • monotonicTimeEstimate

        public long monotonicTimeEstimate()
        Description copied from interface: TimingSource
        Returns an approximation of System.nanoTime(). Performance should be preferred over accuracy by the implementation, but the value is monotonic and expresses time in milliseconds, however, subsequent invocations could return the same value.
        Specified by:
        monotonicTimeEstimate in interface TimingSource
        Returns:
        an increasing value related to time in milliseconds. Only meaningful to compare time intervals, with no guarantees of high precision.
      • nanoTime

        public long nanoTime()
        Description copied from interface: TimingSource
        Returns current system time in nanoseconds. Accuracy is preferred over performance by the implementation.
        Specified by:
        nanoTime in interface TimingSource
        Returns:
        high precision current time in nanoseconds.
      • stop

        public void stop()
        Description copied from interface: TimingSource
        Invoked on engine integration shutdown. There is no start method as it's expected to be lazily initialized
        Specified by:
        stop in interface TimingSource