2018-12-12 20:01:10 +08:00
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2019-04-03 00:03:46 +08:00
|
|
|
|
"time"
|
2019-07-29 21:01:19 +08:00
|
|
|
|
|
|
|
|
|
"github.com/gogf/gf/frame/g"
|
2018-12-12 20:01:10 +08:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2019-04-03 00:03:46 +08:00
|
|
|
|
db := g.DB()
|
2018-12-15 15:50:39 +08:00
|
|
|
|
|
2019-04-03 00:03:46 +08:00
|
|
|
|
// 开启调试模式,以便于记录所有执行的SQL
|
|
|
|
|
db.SetDebug(true)
|
2018-12-12 20:01:10 +08:00
|
|
|
|
|
2019-04-03 00:03:46 +08:00
|
|
|
|
for {
|
|
|
|
|
for i := 0; i < 10; i++ {
|
|
|
|
|
go db.Table("user").All()
|
|
|
|
|
}
|
2020-09-17 23:27:10 +08:00
|
|
|
|
time.Sleep(time.Millisecond * 100)
|
2019-04-03 00:03:46 +08:00
|
|
|
|
}
|
2018-12-12 20:01:10 +08:00
|
|
|
|
|
2019-04-03 00:03:46 +08:00
|
|
|
|
}
|