Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Enable with ---[[ and disable with --[[
- ---[[
- local oldCreateThread = Citizen.CreateThread
- function Citizen.CreateThread(f)
- local trace = debug.traceback("Thread was added here", 2)
- local res = GetResourceName()
- oldCreateThread(function()
- local c = coroutine.create(f)
- while coroutine.status ~= "dead" do
- local start = GetGameTimer()
- local res, err = coroutine.resume(c)
- local time = GetGameTimer()
- if time > 150 then
- print("["..res.."] A thread took "..time.."ms, wtf u doin?")
- print(debug.traceback(c, "Thread yielded here"))
- print(trace)
- end
- if not res then
- print("["..res.."] A thread errored, fix it")
- print(debug.traceback(c, err))
- else
- coroutine.yield(res)
- end
- end
- end)
- end
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement