int untilNextMillis(int lastTimestamp) { int timestamp = currentTimeStamp; while (timestamp <= lastTimestamp) { timestamp = currentTimeStamp; } return timestamp; }