Hi sivasruj,
The following message on the SuSE Linux list seems to be relevant.
Alex Rhomberg wrote:
"I use gettimeofday for time measurement. On my PWS500a with RH 6.1,
this works fine, giving me us resolution. A test on UP2000 with SuSE
6.1 returns the same time every time, with 1ms jumps."
Alex Rhomberg, SuSE Linux mailing list
http://lists.suse.com/archive/suse-axp/2000-Mar/0115.html
So, certainly for RedHat 6.1 he was able to get microsecond
resolution.
In that same posting, Alex Rhomberg also listed the following small C
program that he uses to measure the resolution of gettimeofday on the
RedHat and SuSE systems:
#include <time.h> // for gettimeofday
#include <sys/time.h>
#include <stdio.h>
int main(int argc, char**argv)
{
struct timeval tv1, tv2;
gettimeofday(&tv1, NULL);
do {
gettimeofday(&tv2, NULL);
} while (tv1.tv_usec == tv2.tv_usec);
printf("Difference: %d us\n", tv2.tv_usec - tv1.tv_usec +
1000000 * (tv2.tv_sec - tv1.tv_sec));
return 0;
}
This program should compile and run on any stock RedHat system, and
should provide the confirmation of gettimeofday resolution that you
require.
Google search strategy:
gettimeofday resolution
://www.google.com/search?q=gettimeofday%20resolution
Regards,
eiffel-ga |