Class FakeNanoSource

    • Constructor Detail

      • FakeNanoSource

        public FakeNanoSource()
    • Method Detail

      • incrementTimeNanos

        public void incrementTimeNanos​(long additionalNanos)
        Increment the internal counter by this many fake nanoseconds. Subsequent calls to currentTimeNanoPrecision() will return a value that is at least this much large than the return value from prior calls.
        Parameters:
        additionalNanos - The number of fake nanoseconds to advance the internal counter.
      • currentTimeNanoPrecision

        public long currentTimeNanoPrecision()
        Return the stored fake "current" time value, and increment the stored value by 1.
        Specified by:
        currentTimeNanoPrecision in interface CurrentNanosSource
        Returns:
        The number of nanoseconds that have elapsed since the Unix epoch.