base/common/src/main/com/thesett/common/throttle/BatchedThrottle.java
public void setRate(float hertz)
    {
        // Pass the rate unaltered down to the base implementation, for the check method.
        super.setRate(hertz);

        // Log base 10 over 2 is used here to get a feel for what power of 100 the total rate is.
        // As the total rate goes up the powers of 100 the batch size goes up by powers of 100 to keep the
        // throttle rate in the range 1 to 100.
        int x = (int) (Math.log10(hertz) / 2);
        batchSize = (int) Math.pow(100, x);

        float throttleRate = hertz / batchSize;

        // Reset the call count.
        callCount = 0;

        // Set the sleep throttle wrapped implementation at a rate within its abilities.
        batchRateThrottle.setRate(throttleRate);
    }
public void setRate(float hertz)
    {
        // Pass the rate unaltered down to the base implementation, for the check method.
        super.setRate(hertz);

        // Log base 10 over 2 is used here to get a feel for what power of 100 the total rate is.
        // As the total rate goes up the powers of 100 the batch size goes up by powers of 100 to keep the
        // throttle rate in the range 1 to 100.
        int x = (int) (Math.log10(hertz) / 2);
        batchSize = (int) Math.pow(100, x);

        float throttleRate = hertz / batchSize;

        // Reset the call count.
        callCount = 0;

        // Set the sleep throttle wrapped implementation at a rate within its abilities.
        batchRateThrottle.setRate(throttleRate);
    }
public void setRate ( float hertz ) { // Pass the rate unaltered down to the base implementation, for the check method. super . setRate ( hertz ) ; // Log base 10 over 2 is used here to get a feel for what power of 100 the total rate is. // As the total rate goes up the powers of 100 the batch size goes up by powers of 100 to keep the // throttle rate in the range 1 to 100. int x = ( int ) ( Math . log10 ( hertz ) / 2 ) ; batchSize = ( int ) Math . pow ( 100 , x ) ; float throttleRate = hertz / batchSize ; // Reset the call count. callCount = 0 ; // Set the sleep throttle wrapped implementation at a rate within its abilities. batchRateThrottle . setRate ( throttleRate ) ; }
Specifies the throttling rate in operations per second.

@param hertz The throttling rate in cycles per second.
Specifies the throttling rate in operations per second .