Package com.sun.solaris.service.pools
Class HRTime
- java.lang.Object
-
- com.sun.solaris.service.pools.HRTime
-
- All Implemented Interfaces:
java.lang.Comparable
public class HRTime extends java.lang.Object implements java.lang.Comparable
hrtime_t-like (see gethrtime(3C)) uptime-based time value (i.e., resilient to changes to the host's clock) for comparison of timestamps of sampled data.
-
-
Constructor Summary
Constructors Constructor Description HRTime()
Constructor.HRTime(UnsignedInt64 value)
Constructs a new HRTime with the value of the given UnsignedInt64.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
HRTime
deltaFrom(HRTime older)
Computes the difference between this time and another, older, time.UnsignedInt64
getValue()
Returns this HRTime's value.java.lang.String
toString()
Return a string representation of this instance.
-
-
-
Constructor Detail
-
HRTime
public HRTime()
Constructor.
-
HRTime
public HRTime(UnsignedInt64 value)
Constructs a new HRTime with the value of the given UnsignedInt64.- Parameters:
value
- The timestamp to be used.
-
-
Method Detail
-
deltaFrom
public HRTime deltaFrom(HRTime older)
Computes the difference between this time and another, older, time.- Parameters:
older
- the time from which to compute the delta.- Throws:
java.lang.IllegalArgumentException
- if the given time is not earlier than this one.
-
getValue
public UnsignedInt64 getValue()
Returns this HRTime's value.
-
toString
public java.lang.String toString()
Return a string representation of this instance.- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable
-
-