[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.clock conversion to milliseconds under MacOS X
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 17 Dec 2014 10:49:51 -0200
> > > began = os.clock ()
> > > local elapsed = os.difftime (os.clock (), began)
>
> os.difftime is meant to be used with numbers returned by os.time, not os.clock.
> In POSIX systems, you can simply subtract the numbers, in both cases.
>
> Perhaps the manual should say so.
It already does:
os.clock ()
Returns an approximation of the amount in seconds of CPU time
used by the program.
Note the units ("in seconds"). You can always subtract seconds from
seconds. (That is valid in any system, not only POSIX.)
-- Roberto