public < T > T time ( Callable < T > event ) throws Exception { final long startTime = System . currentTimeMillis ( ) ; try { return event . call ( ) ; } finally { update ( System . currentTimeMillis ( ) - startTime ) ; } }
Times and records the duration of event .