initial import
This commit is contained in:
25
example/fx/fx_test.go
Normal file
25
example/fx/fx_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"zero/core/fx"
|
||||
)
|
||||
|
||||
func BenchmarkFx(b *testing.B) {
|
||||
type Mixed struct {
|
||||
Name string
|
||||
Age int
|
||||
Gender int
|
||||
}
|
||||
for i := 0; i < b.N; i++ {
|
||||
var mx Mixed
|
||||
fx.Parallel(func() {
|
||||
mx.Name = "hello"
|
||||
}, func() {
|
||||
mx.Age = 20
|
||||
}, func() {
|
||||
mx.Gender = 1
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user