If you're going to sleep, does it matter if time.Sleep has a cost?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to golang-nuts+unsubscr...@googlegroups.com.
For m
Hi.
I'd like to write function with spin-loop like this:
func readWait(timeout time.Duration) bool {
deadline := Nanotime() + timeout.Nanoseconds()
for {
if readAvail() {
return true
}
if Nanotime() >= deadline {
return false
}
runtime.Goshed()
}
}
But runtime.nanotime() is not exported. How can