public class NanosecondTimestampFactory extends Object
Note: There are several problems with
System.nanoTime() to date and
the values MUST NOT be persisted. The underlying problem is that the epoch
MAY (and in practice does) change from VM instance to VM instance, often when
the machine is rebooted. For this reason, nano time can appear to "go
backward" rendering it unsuitable for placing timestamps on commit records.
This means that we do not have access to time-based method with more than
millisecond resolution of creating "distinctions" for transaction
Note: Nano time could be made to work in a robust nano time service as long as the base time for the service is adjusted on service start or rollover to never go backward.
|Constructor and Description|
|Modifier and Type||Method and Description|
Generates a timestamp with nanosecond precision that is guarenteed to be distinct from the last timestamp generated by this method within the same VM instance.
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.