Here's a code snippet:
#define DIFF_USEC(low, hi) \
(1000000L * (hi.tv_sec - low.tv_sec) + (hi.tv_usec - low.tv_usec))
char buffer[ETH_HLEN+sizeof(short)];
struct timeval xmitStart, xmitEnd;
do_gettimeofday(&xmitStart);
memcpy(buffer, ðHdr, ETH_HLEN);
memcpy(buffer+ETH_HLEN, &type, sizeof(short));
// this sends something over a network interface card
wrt_transmit_buffer(dev, buffer, sizeof(buffer));
do_gettimeofday(&xmitEnd);
diff = DIFF_USEC(xmitStart, xmitEnd);
How can diff be negative?
Please let me know if you have an explanation.
Thanks,
Olaf
P.S. please also e-mail me, since I'm not on the mailing list
-- Olaf Meyer | mailto://olafm@seas.upenn.edu | _~o Computer and Information Science | http://www.seas.upenn.edu/~olafm | _-\_<, University of Pennsylvania | | (*)/'(*) Philadelphia, PA 19104-6389, USA | PGP: finger -l olafm@seas.upenn.edu- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/