Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.windows.x Subject: Re: X11 on System V Message-ID: <329@auspex.UUCP> Date: 27 Oct 88 20:46:20 GMT References: <8810261306.AA22459@icase.icase.edu> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 29 >> Gettimeofday() call does not exist .... > >You should be able to use the System V "localtime()" function (in my SVR2 >manual it's documented under ctime(3c)) to achieve the same effect, Presumably you meant "time()". "localtime()", under BSD, System V, and just about every other UNIX system, does the same thing; it converts a "UNIX time" value of "seconds since the Epoch" to a local date/time in the form of a multi-radix number. >There are also some other handy routines: gmtime, timezone, and >daylight. The latter two are external variables, actually. And provide the moral equivalent of the "timezone" information that "gettimeofday" stuffs into the structure pointed to by its second argument, if that argument is non-NULL. >One possible drawback: the resolution on localtime is +- 1 second. If this is not a problem, the code should be rewritten to use "time()" EVEN ON BSD SYSTEMS; "time()" works quite well, and is more portable. If this is a problem, then if the only reason they care about sub-second resolution is to find the elapsed time betwen two events with sub-second resolution, they can get sub-second time stamps from "times()" (the stamps are relative to some arbitrary time that may not be the same across reboots, so saving those times into a file won't work). If they really want wall-clock time down to sub-second resolution, they lose.