Open main menu

CDOT Wiki β

Changes

Team Go

240 bytes added, 23:38, 17 December 2017
no edit summary
== Goroutines ==
A goroutine is a function capable of running concurrently with other functions. They're similar to threads except they're much cheaper , light weight and are managed automatically.<source lang="go">package main import ( "fmt" "time") func say(s string) { for i := 0; i < 5; i++ { time.Sleep(100 * time.Millisecond) fmt.Println(s) }} func main() { go say("world") say("hello")} </source>
32
edits