Xref: utzoo comp.lang.c:19920 comp.sources.wanted:8098 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!adam.pika.mit.edu!scs From: scs@adam.pika.mit.edu (Steve Summit) Newsgroups: comp.lang.c,comp.sources.wanted Subject: Re: Timestamp Message-ID: <12687@bloom-beacon.MIT.EDU> Date: 15 Jul 89 01:35:28 GMT References: <1595@stl.stc.co.uk> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: scs@adam.pika.mit.edu (Steve Summit) Lines: 20 In article <1595@stl.stc.co.uk> dsr@stl.stc.co.uk (David Riches) writes: >Has anyone got a timestamp routine, written in C, which has a >resolution of milliseconds (possibly lower)? 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(). It returns a structure which "contains the time since the epoch in seconds, [and] up to 1000 milliseconds of more-precise interval." 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. (X3J11 doesn't appear to help, and neither does POSIX, which I just discovered doesn't endorse ftime, which is a miserable omission, but not a topic for this newsgroup.) Steve Summit scs@adam.pika.mit.edu P.S. Microsoft supplies ftime() for MS-DOS; the version of TurboC I've used doesn't (although later versions may have added it).