com.programix.time
Class DateTools.AcceleratedTimeSource
java.lang.Object
com.programix.time.DateTools.AcceleratedTimeSource
- All Implemented Interfaces:
- DateTools.TimeSource
- Enclosing class:
- DateTools
public static class DateTools.AcceleratedTimeSource
- extends Object
- implements DateTools.TimeSource
Used to speed forward from 'now' to a specified time in the future.
After the speeding gets to the end time, the pace of time returns
to normal.
- Author:
- Paul Hyde
|
Method Summary |
long |
getTime()
Returns the number of milliseconds since 1970-01-01. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DateTools.AcceleratedTimeSource
public DateTools.AcceleratedTimeSource(double speedFactor,
long pretendEndTime)
getTime
public long getTime()
- Description copied from interface:
DateTools.TimeSource
- Returns the number of milliseconds since 1970-01-01.
Some implementations may choose to not use
System.currentTimeMillis() as the source! This flexibility
allows a VM-wide offset or time acceleration to be implemented.
Keep in mind that if time is accelerated,
wait(long msTimeout) and
Thread.sleep(long msDuration)
times requested throughout the VM will likely last too long.
- Specified by:
getTime in interface DateTools.TimeSource
Copyright © 2001-2007
Programix Incorporated.
All rights reserved.
ProgramixGenericLib is free
and is
OSI Certified
Open Source Software under the BSD
license.