This commit is contained in:
bloeys
2022-11-05 01:29:01 +04:00
parent 3b8d74b979
commit ca355b2e06

View File

@ -33,8 +33,10 @@ func test(c *cogo.Coroutine[int, int]) {
println("test yield:", 1)
c.Yield(1)
// Yield here until at least 100ms passed
c.YieldTo(cogo.NewSleeper(100 * time.Millisecond))
// Yield here until the coroutine 'test2' has finished
c.YieldTo(cogo.New(test2, 0))
println("test yield:", 2)