From changes.txt in LP 0.10 package...
and, from Lua 5.0 Reference...- os.time() returns a userdata instead of a number because of problems
with the float-precision, so you have to use os.difftime instead of
doing calculations with the result
The code below is to test the functionality of the function in question for both LP-Win32 and LP 0.10...os.difftime (t2, t1)
Returns the number of seconds from time t1 to time t2. In Posix, Windows, and
some other systems, this value is exactly t2-t1.
Code: Select all
-- difftimetest.lua by Geo Massar, 2005 (aka KawaGeo)
green = Color.new(0,255,0)
local elapsedtime = 0
local t0 = os.clock()
repeat
screen:clear()
elapsedtime = os.difftime(os.clock() - t0)
-- elapsedtime = os.clock() - t0
screen:print(2,2, elapsedtime, green)
screen.waitVblankStart()
screen:flip()
until Controls.read():start()
So, where is the beef? (says an old lady in TV ads if you are old enough to remember. :)