public static <S> Pair<Double, S> clockWithResult(final int loops, final Supplier<S> supplier) {
        final S result = supplier.get(); // warm up
        return Pair.with(IntStream.range(0, loops).mapToDouble(i -> {
            long t = System.nanoTime();
            supplier.get();
            return (System.nanoTime() - t) * 0.000001;
        }).sum() / loops, result);
    }
@author Stephen Mallette (http://stephen.genoprime.com)
@author Daniel Kuppitz (http://gremlin.guru)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/TimeUtil.java