aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-10-28 15:10:46 +0200
committerThomas White <taw@physics.org>2022-10-28 15:10:46 +0200
commit50d0043dd1177c10ba888b614c6766c5e33386e7 (patch)
tree7228a7d23013abcda1cc2e145cbf71682c6f721c
parentaff15b2e6995c9fcf51fd8ef9e253a1db0458c31 (diff)
ASAP::O: Report lag between timestamp and current time
-rw-r--r--src/im-asapo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/im-asapo.c b/src/im-asapo.c
index 82934d50..8b4263a9 100644
--- a/src/im-asapo.c
+++ b/src/im-asapo.c
@@ -206,6 +206,15 @@ void *im_asapo_fetch(struct im_asapo *a, size_t *pdata_size,
*pevent = strdup("//");
profile_end("copy-meta");
+ struct timespec timestamp;
+ struct timespec timenow;
+ asapo_message_meta_get_timestamp(meta, &timestamp);
+ clock_gettime(CLOCK_REALTIME, &timenow);
+ double tnow_s = timenow.tv_sec + 1e-9*timenow.tv_nsec;
+ double tsnd_s = timestamp.tv_sec + 1e-9*timestamp.tv_nsec;
+ double tlag = tnow_s - tsnd_s;
+ STATUS("ASAP::O lag = %.1f s\n", tlag);
+
asapo_free_handle(&err);
asapo_free_handle(&meta);
asapo_free_handle(&data);