Mailing List Archive


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

Re: [tlug] using rusage



On 2008-06-19 17:55 +0900 (Thu), Hung Nguyen Vu wrote:

> return (tsec + ((float) tusec) / 1000000.0);
> that is the return of stopTimer is in second, not usec or msec.

It doesn't matter. Zero is zero, whether it be seconds, milliseconds or
microseconds.

> I expected that after a sleep(1), stopTimer() will return 1 seconds

Well, that's a misunderstanding on your part.

You asked the OS not to schedule your process for at least one second.
Clearly, you won't be using any CPU during that wait; it's what you
specifically asked for.

cjs
-- 
Curt Sampson       <cjs@example.com>        +81 90 7737 2974   
Mobile sites and software consulting: http://www.starling-software.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links