Package org.robwork.sdurw_common
Class TimerUtil
- java.lang.Object
-
- org.robwork.sdurw_common.TimerUtil
-
public class TimerUtil extends java.lang.Object
Access of the system clock so called wall time.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
currentTime()
Returns system clock in seconds
Warning: The date/time at which this timer counts from is platform-specific, so
you should not use it for getting the calendar time.static long
currentTimeMs()
Returns system clock in milli-seconds
Warning: The date/time at which this timer counts from is platform-specific, so
you should not use it for getting the calendar time.static long
currentTimeUs()
Returns system clock in micro-seconds.
Warning: The date/time at which this timer counts from is platform-specific, so
you should not use it for getting the calendar time.void
delete()
static long
getCPtr(TimerUtil obj)
static void
sleepMs(int period)
Sleeps for a period of time
static void
sleepUs(int period)
Sleeps for a period of time
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(TimerUtil obj)
-
delete
public void delete()
-
currentTimeMs
public static long currentTimeMs()
Returns system clock in milli-seconds
Warning: The date/time at which this timer counts from is platform-specific, so
you should not use it for getting the calendar time. It's really only meant for
calculating wall time differences.
-
currentTimeUs
public static long currentTimeUs()
Returns system clock in micro-seconds.
Warning: The date/time at which this timer counts from is platform-specific, so
you should not use it for getting the calendar time. It's really only meant for
calculating wall time differences.
Notice: The timer cannot hold times longer than approx. 2100second.
-
currentTime
public static double currentTime()
Returns system clock in seconds
Warning: The date/time at which this timer counts from is platform-specific, so
you should not use it for getting the calendar time. It's really only meant for
calculating wall time differences.
-
sleepMs
public static void sleepMs(int period)
Sleeps for a period of time
- Parameters:
period
- [in] the time in miliseconds to sleep
-
sleepUs
public static void sleepUs(int period)
Sleeps for a period of time
- Parameters:
period
- [in] the time in microseconds to sleep
-
-