private synchronized long getTimeSynchronized ( ) throws OverClockedException { long current = 0 ; synchronized ( ThreadClockImpl . class ) { current = currentTimeMillis ; } if ( current != lastTimeMs ) { generatedThisInterval = 0 ; lastTimeMs = current ; } if ( generatedThisInterval + 1 >= ( INTERVALS_PER_MILLI * sysInterval ) ) { throw new OverClockedException ( ) ; } return ( ( current + GREGORIAN_CHANGE_OFFSET ) * INTERVALS_PER_MILLI ) + generatedThisInterval ++ ; }
Returns the current time as described in the clock resolution and timestamp sections of the uuid specification .