lua-users home
lua-l archive

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


The Lua manual says:
  Returns an approximation of the amount
  in seconds of CPU time used by the program.

But it appears that on Windows the C function clock()
returns wall-time instead of CPU-time:

As a result, in Lua on Windows, the function
os.clock() returns wall-clock time.
I've tested it on Lua built with both compilers
(Visual Studio and MinGW-w64).

It looks like it's Microsoft's fault
to incorrectly implement C run-time function.
But Lua should workaround this bug.
Or the Lua manual should be corrected.

Found here: