 <p>Keep a counter using <code>long</code>, take the modulus, you don't have to worry about overflow as it will increase by 60 per second and your code needs to run for <code>292471208678</code> years before overflow.</p> <pre><code>long alphacntr = 0; .... public void update(){ alphacntr += 3; int alpha = alphacntr%256; .... } </code></pre>