Created
February 9, 2016 11:22
-
-
Save c0rp-aubakirov/072cb5d12b508bf030dc to your computer and use it in GitHub Desktop.
Timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <R> R executeFunctionWithTimer(Callable<R> f) throws Exception { | |
final Stopwatch timer = Stopwatch.createUnstarted(); | |
timer.start(); | |
R r = f.call(); | |
timer.stop(); | |
LoggerEnabler.logIfEnabled(logger, Level.INFO, timer.toString()); | |
return r; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment