[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040916: Possible pqact issue in LDM?



Steven,

Before you try the LDM release-candidate, would you mind executing the
attached program on the monitoring system and sending me it's output?
It shows the resolution of the gettimeofday() function.

Thanks.

Regards,
Steve Emmerson

#define NDEBUG
#include <assert.h>
#include <stdio.h>
#include <sys/time.h>
#include <time.h>

int
main()
{
    int         n;
    double      res = 1e6;

    for (n = 0; n < 1000; ++n) {
        int             err;
        double          diff;
        struct timeval  tv1, tv2;

        err = gettimeofday(&tv1, NULL);
        assert(err == 0);

        do {
            err = gettimeofday(&tv2, NULL);
            assert(err == 0);
        }
        while (tv1.tv_sec == tv2.tv_sec && tv1.tv_usec == tv2.tv_usec);

        diff = difftime(tv2.tv_sec, tv1.tv_sec) + 
            (tv2.tv_usec - tv1.tv_usec)/1e6;

        if (diff < res)
            res = diff;
    }

    (void)printf("%g\n", res);

    return 0;
}