public class Timeshort
extends java.lang.Object
timeShort: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 seconds UTC:12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 30 41 42 43 44 45 46 47 48 49 timeAdd 12 12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 10 10 10 10 10 10 10 10 10 10 10 10 10 10 9 9 9 9 9For this example the timeShort (relative time) is ~ 6% faster then the UTC time. Realistic a relative time may have toleances in range of ppm, parts per million. For a millisecond counter it means you for 10 ppm tolerance you have a jump in the assignment every 100 second.
Modifier and Type | Field and Description |
---|---|
private long |
absTime
Any absolute timestamp to the
absTime_short . |
private float |
absTime_Millisec7short
Milliseconds for 1 step of shorttime.
|
private int |
absTime_short
The shorttime-stamp to the
absTime timestamp. |
static int |
version
Version, history and license.
|
Modifier and Type | Method and Description |
---|---|
long |
absTimeshort(int timeshort)
Returns the absolute time in milliseconds after 1970 to a given timeshort.
|
void |
clean() |
boolean |
isCleaned() |
float |
millisec7short()
Returns the factor between milliseconds / shorttime_difference
|
float |
millisecShort(int timeshort)
Returns the milliseconds after the last
setTimePoint(long, int, float) according to the given timeshort. |
void |
setTimePoint(long date,
int timeshort,
float millisecPerTimeshort) |
static boolean |
sleep(long millisec)
Universal wait routine without necessity of a try-catch wrapping.
|
int |
timeshort4abstime(long date)
Returns the timeshort steps to the given date according to the last
setTimePoint(long, int, float) . |
public static final int version
clean()
and isCleaned()
to set a new pair of absTime_short and absTime.
sleep(long)
as wrapper around Thread.sleep() without Exception.
private int absTime_short
absTime
timestamp. Set with GralCurveView#setTimePoint(long, int, float)
.private long absTime
absTime_short
. Set with GralCurveView#setTimePoint(long, int, float)
.private float absTime_Millisec7short
public Timeshort()
public Timeshort(Timeshort src)
public long absTimeshort(int timeshort)
public void setTimePoint(long date, int timeshort, float millisecPerTimeshort)
public void clean()
public boolean isCleaned()
public float millisec7short()
public float millisecShort(int timeshort)
setTimePoint(long, int, float)
according to the given timeshort.public int timeshort4abstime(long date)
setTimePoint(long, int, float)
.date
- The current date, it should be later than the date on the setTimePoint(...)public static boolean sleep(long millisec)
millisec
-