public class SbTime extends Inventor implements java.lang.Comparable
See also:
Modifier and Type | Class and Description |
---|---|
static class |
SbTime.TimeVal |
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_FORMAT_DATE |
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SbTime()
Default constructor.
|
SbTime(double sec)
Constructor taking seconds.
|
SbTime(long sec,
long usec)
Constructor taking seconds and microseconds.
|
SbTime(SbTime copyFrom) |
Modifier and Type | Method and Description |
---|---|
void |
add(SbTime tm)
Addition of two times which modifies the time structure.
|
int |
compareTo(java.lang.Object obj) |
void |
divide(double s)
Destructive division by scalar.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
format()
Calls format("%S.%i").
|
java.lang.String |
format(java.lang.String fmt)
Convert to a string.
|
java.lang.String |
formatDate()
Calls formatDate(DEFAULT_FORMAT_DATE).
|
java.lang.String |
formatDate(java.lang.String fmt)
Convert to a date string, interpreting the time as seconds since Jan 1, 1970.
|
double |
getDoubleValue()
Get time in seconds as a double.
|
long |
getMsecValue()
Get time in milliseconds (for Xt).
|
static SbTime |
getTimeOfDay()
Get the current time (seconds since Jan 1, 1970).
|
SbTime.TimeVal |
getValue()
Get time in seconds and microseconds.
|
static SbTime |
maxTime()
Get a time far, far into the future.
|
SbTime |
minus(SbTime t1)
Subtraction of two times.
|
void |
multiply(double s)
Destructive multiplication by scalar.
|
SbTime |
over(double s)
Division by scalar.
|
SbTime |
over(SbTime tm)
Division by another time.
|
SbTime |
plus(SbTime t1)
Addition of two times.
|
SbTime |
remainder(SbTime tm)
Modulus for two times (remainder when time1 is divided by time2).
|
void |
setMsecValue(long msec)
Set time from milliseconds.
|
void |
setToTimeOfDay()
Set to the current time (seconds since Jan 1, 1970).
|
void |
setValue(double sec)
Set time from a double (in seconds).
|
void |
setValue(long sec,
long usec)
Set time from seconds + microseconds.
|
void |
setValue(SbTime copyFrom) |
static void |
sleep(int msec)
Sleep for specified time (in msec).
|
void |
substract(SbTime tm)
Subtraction of two times which modifies the time structure.
|
SbTime |
times(double s)
Multiplication by scalar.
|
static SbTime[] |
toArray(long nativeArray,
long length) |
static void |
usleep(long usec)
Sleep for specified time (in microsec).
|
static SbTime |
zero()
Get a zero time.
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public static final java.lang.String DEFAULT_FORMAT_DATE
public SbTime(SbTime copyFrom)
public SbTime(long sec, long usec)
public SbTime()
public SbTime(double sec)
SbTime(1)
will result in a compilation error. SbTime
(1.0) must be used instead. This is to avoid errors in upgrading from an earlier release, in which SbTime(1)
had different semantics. In future releases, this distinction will be eliminated, and the effect of SbTime
(1.0) and that of SbTime(1)
will be identical.public java.lang.String formatDate()
public java.lang.String format()
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
public static SbTime zero()
public SbTime.TimeVal getValue()
public static void sleep(int msec)
public void setValue(SbTime copyFrom)
public java.lang.String format(java.lang.String fmt)
The uppercase descriptors are formatted with a leading `-' for negative times; the lowercase descriptors are formatted fixed width, with leading zeros. For example, a reasonable format string might be "elapsed time: \%M minutes, \%s seconds". The default value of fmt, "\%S.\%i", formats the time as seconds with 3 digits of fractional precision.\% the `\%' character D total number of days H total number of hours M total number of minutes S total number of seconds I total number of milliseconds U total number of microseconds h hours remaining after the days (00-23) m minutes remaining after the hours (00-59) s seconds remaining after the minutes (00-59) i milliseconds remaining after the seconds (000-999) u microseconds remaining after the seconds (000000-999999)
public long getMsecValue()
public static SbTime[] toArray(long nativeArray, long length)
public static void usleep(long usec)
public static SbTime maxTime()
public java.lang.String formatDate(java.lang.String fmt)
public void setValue(long sec, long usec)
public SbTime over(double s)
public double getDoubleValue()
public void divide(double s)
public SbTime times(double s)
public void setMsecValue(long msec)
public void add(SbTime tm)
public void multiply(double s)
public void substract(SbTime tm)
public void setToTimeOfDay()
public static SbTime getTimeOfDay()
public SbTime remainder(SbTime tm)
public void setValue(double sec)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com