Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!sics.se!uplog.se!uplog.uplog.se!thomas From: thomas@uplog.se (Thomas Tornblom) Newsgroups: comp.unix.questions Subject: Re: ATT Unix millisec clock Message-ID: Date: 9 Aug 90 10:48:32 GMT References: <3213@uniol.UUCP> Sender: thomas@uplog.se (Thomas Tornblom) Distribution: comp Organization: TeleLOGIC Uppsala AB Lines: 49 In-Reply-To: moeller@uniol.UUCP's message of 8 Aug 90 17:36:53 GMT In article <3213@uniol.UUCP> moeller@uniol.UUCP (Klaus Moeller) writes: freiss@nixpbe.UUCP (the hacker) writes: >So far, only SECOND resolution is permitted through the ATT Unix OS to time >the elapsed time of a job. Millisecond resolution (or better) accessed >from a .c executable is desired. I am running ATT Unix Version System 5 >Version 3.2 on a Motorola 68020 based machine. >System interrupts? Shell commands? Any solution to this thorny problem would >be greatly appreciated... We faced the same problem, finer than one-second resolution, here before. We use SysV3.1 on a 68020 type too (with some BSD enhancements). IF you have the select call on your machine, you can build yourself a fine tuneable sleep call. Simply build an empty file set and select on it with the numbber of milliseconds you want to sleep. Since the call has nothing to select, it will time out and your program will resume after that number of millseconds. If you want to have a millisecond - precise clock or somthing like that, I'm sorry, I can offer no help. Klaus Moeller -- / Klaus Moeller, Leiteweg 2, 2940 Wilhelmshaven, West - Germany \ < moeller@uniol.uucp 078326@DOLUNI1.BITNET > \ Fill what's empty, empty what's full and scratch where it itches / Check out times(2). The return value is the number of ticks (interrupts) "from an arbitrary point in the past". The tick frequency can be obtained from as HZ. Normally it will be between 50 and 100 so you wont get ms accuracy. 50 to 100 times better than seconds anyhow. Nowhere in my manual can I find anything saying that the RESOLUTION is in seconds, only that the times are reported in seconds. On our machines we have at least one decimal yielding 100ms resolution. Thomas -- Real life: Thomas Tornblom Email: thomas@uplog.se Snail mail: TeleLOGIC Uppsala AB Phone: +46 18 189406 Box 1218 Fax: +46 18 132039 S - 751 42 Uppsala, Sweden