Posted by member 212670 on 2006-04-27 22:11:30 link

Ya, os.clock () counts in seconds, returning a number to 1/1000th of a second (ex: 1234.567).

My last way was actually very accurate... because each pass through the loop pulled os.clock again, resulting in the os.clock + .0001. So when my timer went off, it was actually ahead by .001 of a second. Silly me...This is the same thing as what I had:
function bang_pauseit (arg)
local start = os.clock () --this line being pretty pointless
local finish = start + tonumber (arg)/1000
while start < finish do
start = os.clock() --note the absense of the + .001
end
end

It looks like you fell in to the same sort of thing with your original way. The first "now" line could be left out by just having "later = (os.time()+lslua.milli()/1000)+(tonumber(time_in_ms)/1000)", since the second "now" has nothing to do with the first...like my first "start" had nothing to do with the second "start".

Anyway... seems like we've arrived at the most efficient work-around. =) Thx etc. I'm learning stuff weeee