MSR_HOST_LATENCY(3)

πŸ’– MSR_HOST_LATENCY(3) πŸ’–

okay bestie, welcome to msr_host_latency β€” a whole library function from libmseed, section 3 of the manual, and honestly? she's a baddie. let's get into it πŸ¦‹


✨ NAME ✨

msr_host_latency β€” calculates the latency between the last sample in a Mini-SEED record and the host computer's time. yeah. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <libmseed.h>

double  msr_host_latency ( MSRecord *msr );

like, that's it. one function, one argument, one double coming back at you. iconic behavior fr fr πŸŽ€


🧚 DESCRIPTION 🧚

so what does she actually do? msr_host_latency calculates the latency, in seconds, of the Mini-SEED data. and how? it takes the difference between:

  • the current time in UTC</> of the host computer, and
  • the time of the last sample</> in the record.

that's the latency. that's it. no cap. ✨

lowkey important: this routine is only really useful when you're dealing with a telemetered data stream or something similar. so if you're not doing that... bestie, this might not be your function. πŸ™ˆ

also, the return type is double precision, yes, but the true precision depends on the accuracy of the host system clock β€” among other things. so don't come for her if the numbers are a little off, it's giving "depends on your hardware" energy 😭


πŸ’€ RETURN VALUES πŸ’€

msr_host_latency returns:

  • seconds of latency when everything slays, or
  • 0.0 on error.

and here's the plot twist: that error 0.0 is indistinguishable from an actual 0.0 latency. so like... a real zero and a sad zero look exactly the same. the audacity. πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Chad Trabant IRIS Data Management Center


and that's the whole page, bestie!! this was the Libmseed API, dated 2006/02/27 β€” vintage but still serving. mwah, go calculate some latency, periodt πŸ’…βœ¨πŸŽ€