mirror of https://github.com/panjf2000/ants.git
update readme files
This commit is contained in:
parent
b0a859aff4
commit
c181c30561
|
@ -52,14 +52,14 @@ import (
|
||||||
|
|
||||||
var sum int32
|
var sum int32
|
||||||
|
|
||||||
func myFunc(i interface{}) error {
|
func myFunc(i interface{}) {
|
||||||
n := i.(int32)
|
n := i.(int32)
|
||||||
atomic.AddInt32(&sum, n)
|
atomic.AddInt32(&sum, n)
|
||||||
fmt.Printf("run with %d\n", n)
|
fmt.Printf("run with %d\n", n)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func demoFunc() error {
|
func demoFunc() {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(10 * time.Millisecond)
|
||||||
fmt.Println("Hello World!")
|
fmt.Println("Hello World!")
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -51,14 +51,14 @@ import (
|
||||||
|
|
||||||
var sum int32
|
var sum int32
|
||||||
|
|
||||||
func myFunc(i interface{}) error {
|
func myFunc(i interface{}) {
|
||||||
n := i.(int32)
|
n := i.(int32)
|
||||||
atomic.AddInt32(&sum, n)
|
atomic.AddInt32(&sum, n)
|
||||||
fmt.Printf("run with %d\n", n)
|
fmt.Printf("run with %d\n", n)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func demoFunc() error {
|
func demoFunc() {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(10 * time.Millisecond)
|
||||||
fmt.Println("Hello World!")
|
fmt.Println("Hello World!")
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue