Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/gen



On Tue, Aug 19, 2003 at 10:50:30AM -0400, Perry E. Metzger wrote:
> 
> Who said this was guaranteed monotonic? In fact, I wouldn't go around
> encouraging its use given how bad the interface is...

Well, it is defined as "the amount of processor time used since the
invocation of the calling process" and time used doesn't usually go backwards!

I've actually never worked out why time taken processing interrupts while
a process is active isn't deemed to be doing work for the active process!

I this case I just ensured the system and user usecs are added together
before being converted to hz.  The code is also smaller and faster!

We don't even guarantee that the 'user time' and 'system time' reported
by getrusage be monotonic [1].  Never mind what happens to the child times
of a shell that runs date(1) to change the system time.

        David

[1] even their sum can go down.

-- 
David Laight: david%l8s.co.uk@localhost



Home | Main Index | Thread Index | Old Index