Package com.gigaspaces.time
Class SystemTime
java.lang.Object
com.gigaspaces.time.SystemTime
A static system time wrapper, which will call the underlying SystemTime.isAbsoluteTime();
SystemTime.isRelativeTime();
ITimeProvider
implementation. usage:
long time = SystemTime.timeMillis();
AbsoluteTime is the default implementation of ITimeProvider.
Custom time implementations can be provided by use of a system property. The value of the
property should name a class implementing ITimeProvider interface.
e.g. for applying a "relative time" provider, you can either: 1. Set via System property: (recommended option)-Dcom.gs.time-provider=com.gigaspaces.time.RelativeTime2. Set via container xml-tag value:<time-provider>com.gigaspaces.time.RelativeTime</time-provider>
All known implementations, can be queried as follows:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longReturns the time in milliseconds specified by the underlying ITimerProvider implementation.
-
Constructor Details
-
SystemTime
public SystemTime()
-
-
Method Details
-
timeMillis
public static long timeMillis()Returns the time in milliseconds specified by the underlying ITimerProvider implementation. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the time-provider implementation and may be larger.- Returns:
- the difference, measured in milliseconds, between the system time and lifetime of the JVM.
-