TimeService implementation
--------------------------
Key: ISPN-3069
URL:
https://issues.jboss.org/browse/ISPN-3069
Project: Infinispan
Issue Type: Feature Request
Reporter: Pedro Ruivo
Assignee: Pedro Ruivo
Fix For: 5.3.0.Final
Implementation of the TimeService as described in the mailling list
http://lists.jboss.org/pipermail/infinispan-dev/2013-April/012667.html
Interface
{code}
long time() //return the current time in nanoseconds
long wallClockTime() //return the current clock time in milliseconds
long timeDuration(long startTime) //duration between current time and startTime. return
value >=0
long wallClockDuration(long startClockTime) //duration between current clock time and
startClockTime. it can be negative
long timeDuration(long startTime, long endTime) //duration between endTime and startTime.
return value >= 0
long wallClockDuration(long startClockTime, long endClockTime) //duration between
startClockTime and endClockTime. it can be negative
//other possible methods
double convertNanosecondsToMicroseconds(long nanos) //convert from nanos to micros
without losing precision
double convertNanosecondsToSeconds(long nanos) //convert from nanos to seconds without
losing precision
boolean isExpired(long currentWallClock, long endWallClock) //returns true if the
endWallClock has expired
{code}
Default implementation will wrap System.nanoTime() and System.currentTimeMillis().
Provide also a no-op implementation?
other suggestions are welcome.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: