Posted 23 November 2012 - 06:17 PM
Hey, I was messing around with the 'os.time()' and 'os.clock()' features of the os API and I stumbled along something odd.
clock = os.clock()
time = os.time()
sleep(1)
clock = os.clock() - clock
time = os.time() - time
print("Clock: "..clock)
print("Time: "..time)
if time ~= clock/50 then
print("Time was changed")
end
The code above will print "Time was changed" even though time was actually clock/50. Am I using the wrong operator or is my math just fail? Anyway, I was just wondering if someone could answer that for me. Since I'm a little stumped.