Xref: utzoo comp.lang.c:19955 comp.sources.wanted:8124 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!bbn!ginosko!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.lang.c,comp.sources.wanted Subject: Re: Timestamp Message-ID: <2247@auspex.auspex.com> Date: 17 Jul 89 18:07:46 GMT References: <1595@stl.stc.co.uk> <12687@bloom-beacon.MIT.EDU> Reply-To: guy@auspex.auspex.com (Guy Harris) Followup-To: comp.sources.wanted Organization: Auspex Systems, Santa Clara Lines: 24 >The implementation of such a routine would be highly system- >dependent. A somewhat standard but little-known routine already >exists which provides what you want: ftime(). 1) "somewhat standard" is the key word here. In the UNIX world, it's in V7, and in 4.xBSD, but not in System V. >It returns a structure which "contains the time since the epoch in seconds, >[and] up to 1000 milliseconds of more-precise interval." 2) "more precise" doesn't necessarily mean "precise down to the millisecond"; it will probably reflect the resolution of the OSes clock, which is may well be closer to 10 milliseconds than one millisecond. >If your vendor happens to provide an implementation of this >routine, you're in luck; if not, there's not much portable you >can do. Unless your vendor happens to provide an implementation of "gettimeofday()", which first appeared in 4.2BSD, and upon which "ftime()" is implemented in 4.xBSD and many systems that picked up "gettimeofday()" from it. The previous comment about resolution applies to it as well....