Skip to content

Instantly share code, notes, and snippets.

@sjp38
Last active November 5, 2015 08:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjp38/dcdb6295e10f1cfe919b to your computer and use it in GitHub Desktop.
Save sjp38/dcdb6295e10f1cfe919b to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"runtime"
"time"
)
func main() {
runtime.GOMAXPROCS(1)
val := 0
go func() {
for true {
val += 1
}
}()
time.Sleep(1000 * time.Millisecond)
fmt.Printf("%d\n", val)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment