But it appears that on Windows the C function clock()
returns wall-time instead of CPU-time:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/clock?view=vs-2019
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.