diff options
author | Thomas White <taw@physics.org> | 2022-10-28 15:10:46 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2022-10-28 15:10:46 +0200 |
commit | 50d0043dd1177c10ba888b614c6766c5e33386e7 (patch) | |
tree | 7228a7d23013abcda1cc2e145cbf71682c6f721c /src/im-asapo.c | |
parent | aff15b2e6995c9fcf51fd8ef9e253a1db0458c31 (diff) |
ASAP::O: Report lag between timestamp and current time
Diffstat (limited to 'src/im-asapo.c')
-rw-r--r-- | src/im-asapo.c | 9 |
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, ×tamp); + 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); |