Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!oliveb!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.unix.aux Subject: Re: gettimeofday() Message-ID: <51320@sun.uucp> Date: 29 Apr 88 08:39:33 GMT References: <930@unisoft.UUCP> Sender: news@sun.uucp Lines: 19 > I've noticed that gettimeofday() (the A/UX emulation of the BSD system > call) may run slower than many people think (a number of programs - CAP, X > NeWS etc use this heavily), in BSD the timezone information is obtained > from the kernel, in A/UX it must come from disk ..... 5 minutes with adb > shows that if you don't want the timezone information (most applications > do not) the following macro can be used: > > > #define gettimeofday(time, timezone) _gettimeofday(time) 1) Could not "gettimeofday()" have a static flag that indicates whether it's called "tzset()" or not, so that only the first call to "gettimeofday()" calls "tzset()"? 2) Does not "gettimeofday()" avoid calling "tzset()" at all if "timezone" is NULL? Lots of programs (all the properly-written ones) that call "gettimeofday()" explicitly indicate their disinterest in the timezone information by passing a (properly-case, of course) null pointer as the second argument, and most programs that call "gettimeofday()" don't want the timezone information.