I am wondering what is the most efficient and fastest way to create a new thread?
I have tried both and roblox events to create thread and coroutines, but now met on the problem with LocalScripts running slow (server is unaffected). Right now I uses this method to create a new thread:
local run = script.run
local module = {
new = function(f)
local con
con = run.Changed:Connect(function()
con:disconnect()
f()
end)
return {
func = f,
run = function(self)
run.Value = not run.Value
end
}
end
}
I feel the prev is faster (what I am doing works better with this), but I don’t know if it is more efficient, So is my method more efficient than doing:
coroutine.resume(coroutine.create(function()
--something here
end))
Or does there exist faster and/or more efficient methods?