Java - how do i set a value every "n" minute : <p>double x = 0;</p>

<p>every 20 minutes the x shall add by 5.
every 30 minutes the x shall add by 6.
every hour the x shall add by 12.</p>

<p>and every remaining second shall add by 0.2</p>
