void delay ( long alreadyElapsed ) { recorder . recordValue ( alreadyElapsed ) ; if ( distribution != null ) { long nextPermitted = Math . round ( distribution . sample ( ) * 1000000000.0 ) ; if ( nextPermitted > alreadyElapsed ) { LockSupport . parkNanos ( nextPermitted - alreadyElapsed ) ; } } }
Record the event elapsed time to the histogram and delay initiation of the next event based on the load distribution .