Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time.After and time.Sleep, channels with timeouts #35

Open
glycerine opened this issue Mar 7, 2018 · 1 comment
Open

time.After and time.Sleep, channels with timeouts #35

glycerine opened this issue Mar 7, 2018 · 1 comment

Comments

@glycerine
Copy link
Contributor

This is the last part of the scheduler and of channel work that is still missing.

goroutines selecting on time.After() should be able to sleep and wake up when
their timeout happens.

time.Sleep() should put a goroutine to sleep for a given time, allowing it to
continue execution after the pause.

@glycerine
Copy link
Contributor Author

glycerine commented Mar 8, 2018

time.Sleep() works on the main goroutine.

gi> import "time"

elapsed: '69.063µs'
gi> time.Sleep(time.Second * 2)

elapsed: '2.005103039s'
gi>

but it also puts the entire scheduler/repl to sleep at the same time, even if run on a goroutine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant