Add event time for timers and phased loops
This is the beginning of the framework needed to measure timing reports.
This fills in the last event times needed. Watchers and Fetchers
already have the times well covered.
Change-Id: I31ce8814cee3607a4e615b0359f1408ced1258bc
diff --git a/aos/time/time.cc b/aos/time/time.cc
index 549dae7..95044a4 100644
--- a/aos/time/time.cc
+++ b/aos/time/time.cc
@@ -53,6 +53,16 @@
#endif // __linux__
namespace aos {
+
+void PrintTo(const monotonic_clock::time_point t, std::ostream *os) {
+ auto s = std::chrono::duration_cast<std::chrono::seconds>(t.time_since_epoch());
+ *os << s.count() << "."
+ << std::chrono::duration_cast<std::chrono::nanoseconds>(
+ t.time_since_epoch() - s)
+ .count()
+ << "sec";
+}
+
namespace time {
struct timespec to_timespec(