@@ -0,0 +1,1039 @@
+package net.dempsy.util;%0A%0A/**%0A * This class will execute the Runnable provided to the constructor%0A * once every so many calls to %7B@code run()%7D. It's meant to be used%0A * in a high performance loop so it uses a mask rather than a mod%0A * to determine when to actually do the call.%0A */%0Apublic class OccasionalRunnable %7B%0A%0A    private final long mask;%0A    private long callCount = 0;%0A%0A    public OccasionalRunnable(final long frequency) %7B%0A        if(Long.bitCount(frequency) != 1)%0A            throw new IllegalArgumentException(%22When using an %22 + OccasionalRunnable.class.getSimpleName() + %22 the frequency must be a power of 2%22);%0A        this.mask = frequency - 1;%0A    %7D%0A%0A    public void maybeRun(final Runnable work) %7B%0A        callCount++;%0A        if((callCount & mask) == 0)%0A            work.run();%0A    %7D%0A%0A    public static Runnable staticOccasionalRunnable(final long frequency, final Runnable runnable) %7B%0A        final OccasionalRunnable partial = new OccasionalRunnable(frequency);%0A        return () -%3E partial.maybeRun(runnable);%0A    %7D%0A%0A%7D%0A

Add a utility to run anything (used in debug logging initially) on a periodic basis.