public int getTicks() {
        long i = Ticker.getTime();
        if (i - s2 > rate) {
            int ticks = (int) ((i - s2) / (long) rate);
            s2 += (long) rate * ticks;
            return ticks;
        }
        return 0;
    }