Re: Problem with frame time stamping

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Dumazet
Date: Tuesday, November 13, 2007 - 3:36 am

Antoine Zen-Ruffinen a écrit :
But then, maybe your problem comes from your code : timeStamp should be 
declared as "struct timeval" of course, to get both tv_sec and tv_usec.

struct timeval tv;
ioctl(sock, SIOCSTAMP, &tv);
printf("packet arrived at %ld.%06ld\n", (long)tv.tv_sec, (long)tv.tv_usec);


If you *want* nanosecond resolution instead of microsecond, use :

struct timespec ts;
ioctl(sock, SIOCSTAMPNS, &ts);
printf("packet arrived at %ld.%09ld\n", (long)ts.tv_sec, (long)ts.tv_nsec);




-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Problem with frame time stamping, Antoine Zen-Ruffinen, (Mon Nov 12, 8:42 am)
Re: Problem with frame time stamping, Eric Dumazet, (Mon Nov 12, 9:47 am)
Re: Problem with frame time stamping, Antoine Zen-Ruffinen, (Tue Nov 13, 3:07 am)
Re: Problem with frame time stamping, Eric Dumazet, (Tue Nov 13, 3:27 am)
Re: Problem with frame time stamping, Eric Dumazet, (Tue Nov 13, 3:36 am)
Re: Problem with frame time stamping, Antoine Zen-Ruffinen, (Tue Nov 13, 3:39 am)
Re: Problem with frame time stamping, Antoine Zen-Ruffinen, (Tue Nov 13, 3:43 am)
Re: Problem with frame time stamping, Eric Dumazet, (Tue Nov 13, 3:55 am)
Re: Problem with frame time stamping, Antoine Zen-Ruffinen, (Tue Nov 13, 5:34 am)
Re: Problem with frame time stamping, Eric Dumazet, (Tue Nov 13, 6:13 am)
Re: Problem with frame time stamping, Antoine Zen-Ruffinen, (Tue Nov 13, 7:46 am)