lua-users home
lua-l archive

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


In Lua 5.1.4 I am measuring time like this on my MacOSX 10.6.5 running hexacore MacPro without much other activity:

local timestart = os.clock()
print ("start",os.date())
-- doing some work
print("    Conversion took " .. os.difftime(os.clock(), timestart) .. " seconds")
print ("stop",os.date())

The result is this:
start	Fri Dec 31 14:08:04 2010
    Conversion took 85 seconds
stop	Fri Dec 31 14:10:38 2010

Now 14:10:38 - 14:08:04 is to me 2 minutes and 34 seconds, thus 154 seconds.
That is far away from the reported 85 seconds.

Any idea what is happening here? 

I do not think this is a difference between actual computation time and clock time, the machine certainly is too powerfull to spent so much time in overhead.

Hans van der Meer