double millis = Math.floor((t - now) * 1000);
double nanos = Math.rint((t - now) * 1e9 - millis * 1e6);
Thread.sleep((long) millis, (int) nanos);
}
String topic = "topic-" + topicSampler.sample();
String message = "m-" + (++messageId);
client.sendMessage(topic, message);
recorder.message(topic);
log.debug("Sent {} / {}", topic, message);
if ((messageId % 10000) == 0) {