Print sendtime of messsages.
Change-Id: I42579bce6133a536df61da9355aed763a0b2e614
diff --git a/aos/common/message.h b/aos/common/message.h
index 8ae7f16..f46969f 100644
--- a/aos/common/message.h
+++ b/aos/common/message.h
@@ -28,7 +28,11 @@
size_t Serialize(char *buffer) const;
// Populates sent_time with the current time.
- void SetTimeToNow() { sent_time = monotonic_clock::now(); }
+ void SetTimeToNow() {
+ if (sent_time == monotonic_clock::min_time) {
+ sent_time = monotonic_clock::now();
+ }
+ }
// Writes the contents of the message to the provided buffer.
size_t Print(char *buffer, int length) const;