I am using a library that returns a structure with a time stamp that is represented by two (TimestampHi, TimestampLo) unsigned longs. I pretty much only need the timestamp printed out as %llu in printf.
What’s the easiest way to get the data from these two ints and correctly use it as a uint64_t?
Assuming that
unsigned long longis a 64-bit type on your platformAnd then print the
Timestampvalue.Same thing as an one-liner
or simply
If you wish to abstract your code from bit-based operations, the expression can be rewritten as