Исходники и презентации
This commit is contained in:
19
lessons/goroutines_and_scheduler/runtime_exit/main.go
Normal file
19
lessons/goroutines_and_scheduler/runtime_exit/main.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
go func() {
|
||||
for {
|
||||
time.Sleep(time.Second)
|
||||
fmt.Println("tick")
|
||||
}
|
||||
}()
|
||||
|
||||
time.Sleep(3 * time.Second)
|
||||
runtime.Goexit()
|
||||
}
|
||||
Reference in New Issue
Block a user