ATT Unix millisec clock

the hacker freiss at nixpbe.UUCP
Thu Aug 9 20:18:03 AEST 1990


In <13494 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) writes:

>In article <freiss.649671180 at peun33> freiss at 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...

>Unfortunately, you have not stated a problem, but rather a desired SOLUTION.
>If we knew what the real problem to be solved was, perhaps we could suggest
>something helpful.

Right :-)
ok, what Nick Kawaguchi wants is

a) something like a profiler with millisecond resolution to time
   how long a C-function takes to execute.
   BTW, thanks to all of you who replied suggesting the times() system
   call. He uses that now, though something that has a better resolution
   would be more useful.

b) a sleep() call with millisecond or tenth of second resolution.
   Curses has a napms() function that supposedly does exactly that,
   but I'm told it is unreliable (i.e. doesn't really nap milliseconds,
   but 1 / HZ seconds).

My guess is it's impossible, but then I'm not very wizardly concerning
UN*X.
All hints are appreciated.

Thanks,
-Martin         freiss.pad at nixdorf.com



More information about the Comp.unix.questions mailing list