@ Override public byte [ ] call ( final byte [ ] memento ) { LOG . log ( Level . FINE , "Task started: sleep for: {0} msec." , this . delay ) ; final long ts = System . currentTimeMillis ( ) ; for ( long period = this . delay ; period > 0 ; period -= System . currentTimeMillis ( ) - ts ) { try { Thread . sleep ( period ) ; } catch ( final InterruptedException ex ) { LOG . log ( Level . FINEST , "Interrupted: {0}" , ex ) ; } } LOG . log ( Level . FINE , "Task finished after {0} msec." , System . currentTimeMillis ( ) - ts ) ; return null ; }
Sleep for delay milliseconds and return .