lua-users home
lua-l archive

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

On Tue, Sep 27, 2011 at 08:14:31PM +0100, David Given wrote:

> Just out of interest, has anyone used os.clock() for *anything*, ever?
> (Not counting Windows systems where it's equivalent to os.time().)

Yes: for measuring the performance of code without the effect of other
processes on the same machine.  Given it measures CPU seconds, it's
ideal.  Using wall-clock time for such measurements can result in skewed
results if suddenly updatedb runs, or a fat email arrives while you run
your test.