Mailing List Archive


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

Re: [tlug] using rusage



On Thu, Jun 19, 2008 at 12:50 PM, Curt Sampson
<cjs@example.com> wrote:
>
> On 2008-06-19 11:30 +0900 (Thu), Hung Nguyen Vu wrote:
>
> > What is wrong with this code?
> >
> > wget http://aoclife.ddo.jp/~vuhung/tmp/testTimer.c
> > gcc testTimer.c
> > ./a.out
> > stop:   0.000
> > stop:   0.000
> > stop:   0.000
> > stop:   0.000
>
> Absolutely nothing, as far as I can tell. Your program is reporting
> exactly the results one would expect.

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

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



--
Best Regards,
Nguyen Hung Vu ( Nguyễn Vũ Hưng )
vuhung16plus{remove}@example.com , YIM: vuhung16 , Skype: vuhung16dg
Japan through an eye of a gaijin:
http://www.flickr.com/photos/vuhung/tags/fav/

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links