My code here:
coroutine.wrap(function()
local x = os.clock() + 3
repeat until os.clock() >= x
print("Hi")
end)()
print("Bye")
Usually, the expected output should be "Bye" and then wait 3 seconds to print "Hi". However, the coroutine yielded first and printed Hi before Bye.
Did I do something wrong in my code? I am new to coroutines.