@Override
    public boolean nextConfig(long timeout) {
        if (hasConfigChanged()) return true;
        if (timeout <= 0) return false;

        long startNanos = System.nanoTime();
        do {
            sleep();
            if (hasConfigChanged()) return true;
        } while (System.nanoTime() - startNanos < timeout * 1_000_000);
        return false;
    }
Subscription on a programmatically built set of configs

@author Vegard Havdal
config/src/main/java/com/yahoo/config/subscription/impl/ConfigSetSubscription.java