[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: get time in ms?
- From: Enrico Colombini <erix@...>
- Date: Mon, 16 Nov 2009 09:22:28 +0100
Cheng, Long wrote:
The POSIX standard specifies os.clock() returning CPU time used. But
microsoft POSIX library os.clock() returns wall time elapsed since the
process started. You'd better avoid using it when your lua code is
supposed to run both on Windows and Linux. We learned this a hard way.
http://msdn.microsoft.com/en-us/library/4e2ess30%28VS.80%29.aspx
Thanks! Now at last I understand why I didn't understand :-) I always
used os.clock() as wall-clock time (on Windows) and was quite suprised
at discovering it was intended to measure CPU time.
What about the Mac? CPU time, I suppose, being Unix-based?
Enrico