Jump to content

Is Lua really limited?


ShayF2

Recommended Posts

@spenkbang

local seconds = 0

local timer = setTimer(function() seconds = seconds + 1 end, 1000, 0)

function stopCount()
	killTimer(timer)
	return seconds
end

or you can try a loop function

local seconds = 0

function startCount()
	seconds = seconds + 1
	return continue()
end

function continue()
	seconds = seconds + 1
	return startCount()
end

function stopCount()
	continue = function() end
	return seconds
end

Which can go less than 50 ms, this should be capable of getting close to 1ms

Edited by ShayF
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...