Add utility class for timer package.

This commit is contained in:
garbagemule
2014-02-25 02:11:43 +01:00
parent 937faea5e0
commit bf8c244fce
@@ -0,0 +1,23 @@
package com.garbagemule.MobArena.util.timer;
public class Common {
/**
* Convert seconds to ticks.
*
* @param seconds value to convert
* @return the value converted to ticks
*/
public static long toTicks(int seconds) {
return seconds * 20l;
}
/**
* Convert ticks to seconds.
*
* @param ticks value to convert
* @return the value converted to seconds
*/
public static int toSeconds(long ticks) {
return (int) (ticks / 20l);
}
}