@Test public void testAccurateTimestamp() throws Exception { final IdWorker worker = new IdWorker(1, 1); final Long time = System.currentTimeMillis(); assertThat(worker.getTimestamp() - time).isLessThan(50L); }
public long getTimestamp() { return System.currentTimeMillis(); }
IdWorker { public long getTimestamp() { return System.currentTimeMillis(); } }
IdWorker { public long getTimestamp() { return System.currentTimeMillis(); } IdWorker(final int workerId, final int datacenterId);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence);  IdWorker(final int workerId, final int datacenterId,
            final boolean validateUserAgent);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent,
            final MetricRegistry registry); }
IdWorker { public long getTimestamp() { return System.currentTimeMillis(); } IdWorker(final int workerId, final int datacenterId);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence);  IdWorker(final int workerId, final int datacenterId,
            final boolean validateUserAgent);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent,
            final MetricRegistry registry); long getId(final String agent); int getWorkerId(); int getDatacenterId(); long getTimestamp(); long getSequence(); void setSequence(final long value); synchronized long nextId(); boolean isValidUserAgent(final String agent); }
IdWorker { public long getTimestamp() { return System.currentTimeMillis(); } IdWorker(final int workerId, final int datacenterId);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence);  IdWorker(final int workerId, final int datacenterId,
            final boolean validateUserAgent);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent);  IdWorker(final int workerId, final int datacenterId,
            final long startSequence, final boolean validateUserAgent,
            final MetricRegistry registry); long getId(final String agent); int getWorkerId(); int getDatacenterId(); long getTimestamp(); long getSequence(); void setSequence(final long value); synchronized long nextId(); boolean isValidUserAgent(final String agent); static final long TWEPOCH; }