com.kuka.common
Class TimeStamp

java.lang.Object
  extended by com.kuka.common.TimeStamp

public class TimeStamp
extends Object

Timestamp Support Class for interaction to Realtimesystem. Timestamps, beeing computed/sent by realtimesystem can be converted to java time. ACHTUNG: 2038 wird diese Technik überfliessen, da der integer (int32) zu dieser Zeit negativ wird.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
TimeStamp(int[] timestamp)
          Initialisierung des Timestamps im Unix/C Tupel (sys/time.h).
TimeStamp(long timestampSec, int timestampNanoSec)
          Initialisierung des Timestamps im Unix/C Tupel (sys/time.h).
 
Method Summary
 long toMillis()
          Erzeugt Millisekundendarstellung wie sie für Java System.currentTimeInMillis() kompatibel ist.
static long toMillis(int[] timestampAsIntArray)
          Konvertiert eine Timestamp array nach Millisekunden.
static long toMillis(long timestampSec, int timestampNsec)
          Wandelt die Eingangsparameter in Millisekunden um.
 long toNanos()
          Wandelt den Timestamp in NanoSekunden um...
static long toNanos(long timestampSec, int timestampNanoSec)
          converts a timestamp (e.g. from realtime system) to time in nanoseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeStamp

public TimeStamp(long timestampSec,
                 int timestampNanoSec)
Initialisierung des Timestamps im Unix/C Tupel (sys/time.h). ACHTUNG: Zeitbombe: Sunrise wird im Jahr 2038 überfliessen, da der integer (int32) zu dieser Zeit negativ wird.

Parameters:
timestampSec - Zeit in Sekunden seit 1.1.1970.
timestampNanoSec - NanoSekunden innerhalb og. Sekunde.

TimeStamp

public TimeStamp(int[] timestamp)
Initialisierung des Timestamps im Unix/C Tupel (sys/time.h). ACHTUNG: Zeitbombe: Sunrise wird im Jahr 2038 überfliessen, da der integer (int32) zu dieser Zeit negativ wird.

Parameters:
timestamp - Dimension 2 - timestamp[0] - Zeit in Sekunden seit 1.1.1970 timestamp[1] - NanoSekunden innerhalb og Sekunde
Method Detail

toMillis

public long toMillis()
Erzeugt Millisekundendarstellung wie sie für Java System.currentTimeInMillis() kompatibel ist. Returns the timestamp in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.

See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).

Returns:
long - milliseconds measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
See Also:
Date

toNanos

public long toNanos()
Wandelt den Timestamp in NanoSekunden um... ACHTUNG: Dieser Wert kann überfliessen - braucht einige Jahre..

Returns:
long - nanoseconds seit 1.1.197 modulo XX überfliessen
See Also:
System.nanoTime

toMillis

public static long toMillis(long timestampSec,
                            int timestampNsec)
Wandelt die Eingangsparameter in Millisekunden um.

Parameters:
timestampSec - - Zeit in Sekunden
timestampNsec - - Unterzeit in Nanosekunden
Returns:
millisekunden

toMillis

public static long toMillis(int[] timestampAsIntArray)
Konvertiert eine Timestamp array nach Millisekunden.

Parameters:
timestampAsIntArray - [0] Sekunden, [1] nanoSekunden
Returns:
long millisekunden.

toNanos

public static long toNanos(long timestampSec,
                           int timestampNanoSec)
converts a timestamp (e.g. from realtime system) to time in nanoseconds.

Parameters:
timestampSec - - base e.g. in os_clock_read()
timestampNanoSec - - base e.g. in os_clock_read()
Returns:
long time in nanoseconds


Copyright © 2019. All rights reserved.