synchronized(Timestamper.class) { long newTime = System.currentTimeMillis() << BIN_DIGITS; if (time<newTime) { time = newTime; counter = 0; } else if (counter < ONE_MS - 1 ) { counter++; } return time + counter; }