[freetds] Query Time Out

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Fri Aug 11 05:08:32 EDT 2006

> On Aug 8,  7:00pm, freddyz77 at tin.it (Frediano Ziglio) wrote:
> -- Subject: Re: [freetds] Query Time Out
> | Hi Christos,
> |   I used time mainly for... historic reasons! That is code was just
> | here... why should we use gettimeofday instead? We need only second
> | precision.
> Not a problem, it is just that time(3) is usually a wrapper for
> gettimeofday(2), and you get the extra precision for free. In my
> experience having more precision is always better even if you
> don't need it right now.
> christos

Mmmm... why not using clock_gettime where available then?

Looking at qemu sources I found this funny function. I always don't
liked very much gettimeofday for such computation. The reason? The main
problem is that this function (time and ftime have same problem) is
bound to local time since midnight. For this reason clock may go
backward when time is adjusted for locale setting (from/to daylight
saving time). For the same reason (I think) my X goes blank for some
seconds when ntp adjust the time... clock_gettime(CLOCK_MONOTONIC, ...)
is posix and don't have this problem. 


More information about the FreeTDS mailing list