Endace Measurement Systems Ltd
EDM01.05-01r1 DAG 4.3GE Card User Manual
www.endace.com
7.2 Timestamps
, continued
Example code
Here is some example code showing how a 64-bit ERF timestamp (erfts)
can be converted into a struct timeval representation (tv).
unsigned long long lts;
struct timeval tv;
lts = erfts;
tv.tv_sec = lts >> 32;
lts = ((lts & 0xffffffffULL) * 1000 * 1000);
lts += (lts & 0x80000000ULL) << 1; /* rounding */
tv.tv_usec = lts >> 32;
if(tv.tv_usec >= 1000000) {
tv.tv_usec -= 1000000;
tv.= 1;
}
Copyright© All rights reserved
38
Revision 6. 22 September 2005.
Содержание DAG 4.3GE
Страница 1: ...EDM01 05 01r1 DAG 4 3GE Card User Manual...