com.gtosoft.libvoyager.util
Class EasyTime

java.lang.Object
  extended by com.gtosoft.libvoyager.util.EasyTime

public class EasyTime
extends java.lang.Object


Constructor Summary
EasyTime()
          Constructor.
 
Method Summary
static java.lang.String currentDateAndTimeStamp()
          Returns a string containing the current time stamp.
static long getUnixTime()
           
 long getUptimeMillis()
           
 long getUptimeSeconds()
           
 int getUptimeSecondsINT()
           
static boolean safeSleep(int millis)
          Sleep for the specified number of milliseconds.
 void setMillisBetweenUpdate(int millisToWaitBetweenUpdates)
          Sets the number of milliseconds between updates to the time variable.
 void shutdown()
          Shuts down the EasyTime class and prepares it for gc.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EasyTime

public EasyTime()
Constructor.

Method Detail

getUptimeMillis

public long getUptimeMillis()
Returns:
- returns current uptime millis time stamp.

getUptimeSeconds

public long getUptimeSeconds()
Returns:
- returns uptime of this instance of EasyTime. In seconds.

getUptimeSecondsINT

public int getUptimeSecondsINT()
Returns:
- an integer of the current seconds & 0xFFFF so its really just seconds incrementing.

getUnixTime

public static long getUnixTime()

currentDateAndTimeStamp

public static java.lang.String currentDateAndTimeStamp()
Returns a string containing the current time stamp.

Returns:
- a string.

safeSleep

public static boolean safeSleep(int millis)
Sleep for the specified number of milliseconds.

Parameters:
millis - - number of milliseconds to pause the current thread.
Returns:
- false if the sleep was interrupted, true otherwise.

setMillisBetweenUpdate

public void setMillisBetweenUpdate(int millisToWaitBetweenUpdates)
Sets the number of milliseconds between updates to the time variable.

Parameters:
millisToWaitBetweenUpdates - - number of milliseconds.

shutdown

public void shutdown()
Shuts down the EasyTime class and prepares it for gc.