Adds wall time field to events
[lttv.git] / lttv / lttv / sync / data_structures.c
index 70eb22c74a84f6d56f957f2d81da5f4d4422072e..d4c804b68523c20f7778ea4a6ae25060b8c0a3a5 100644 (file)
@@ -563,3 +563,18 @@ void gfDestroyEvent(gpointer data, gpointer user_data)
 
        event->destroy(event);
 }
+
+
+/* Subtract two WallTime structs
+ *
+ * Args:
+ *   tA, tB:       WallTime
+ *
+ * Returns:
+ *   The result of tA - tB, as a double. This may incur a loss of
+ *   precision.
+ */
+double wallTimeSub(const WallTime const* tA, const WallTime const* tB)
+{
+       return tA->seconds - tB->seconds + (tA->nanosec - tB->nanosec) / 1e9;
+}
This page took 0.022846 seconds and 4 git commands to generate.