Runnable (final String name) { if (!LOG.isDebugEnabled()) { return EmptyRunnable.INSTANCE; } long start = System.nanoTime(); return () -> LOG.debug(name + " in " + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start) + "ms"); }