Skip to content

Instantly share code, notes, and snippets.

@Quenty
Created December 15, 2020 02:27
Show Gist options
  • Save Quenty/0d777194939e2380f89ed109cbb7752e to your computer and use it in GitHub Desktop.
Save Quenty/0d777194939e2380f89ed109cbb7752e to your computer and use it in GitHub Desktop.
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local printRender = false
UserInputService.InputBegan:ConnectParallel(function(inputObject)
print("Running parallel (ConnectParallel) ", tick())
printRender = true
end)
UserInputService.InputBegan:Connect(function(inputObject)
print("Running synchronious (Parallel)", tick())
printRender = true
end)
UserInputService.InputBegan:ConnectParallel(function(inputObject)
printRender = true
task.synchronize()
printRender = true
print("Running synchronious (ConnectParallel, task.synchronize())", tick())
end)
UserInputService.InputBegan:Connect(function(inputObject)
printRender = true
task.desynchronize()
printRender = true
print("Running parallel (task.desynchronize())", tick())
end)
RunService.RenderStepped:Connect(function()
if printRender then
printRender = false
print("RenderStepped occured", tick())
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment