Skip to content

Commit af40551

Browse files
committed
Update dev/load.go
1 parent 86a605a commit af40551

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

dev/load.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
const _numConcurrent = 5
3232
const _numRequestsPerThread = -1
3333
const _requestDelay = 0 * time.Second
34-
const _num_main_loops = 10
34+
const _numMainLoops = 10
3535

3636
var _client = &http.Client{
3737
Timeout: 600 * time.Second,
@@ -40,6 +40,19 @@ var _client = &http.Client{
4040
},
4141
}
4242

43+
func main() {
44+
start := time.Now()
45+
loopNum := 1
46+
for true {
47+
run()
48+
if loopNum >= _numMainLoops {
49+
break
50+
}
51+
loopNum++
52+
}
53+
fmt.Println("total elapsed time:", time.Now().Sub(start))
54+
}
55+
4356
func run() {
4457
start := time.Now()
4558

@@ -74,19 +87,6 @@ func run() {
7487
fmt.Println("elapsed time:", time.Now().Sub(start))
7588
}
7689

77-
func main() {
78-
start := time.Now()
79-
loop_num := 1
80-
for true {
81-
run()
82-
if loop_num >= _num_main_loops {
83-
break
84-
}
85-
loop_num++
86-
}
87-
fmt.Println("total elapsed time:", time.Now().Sub(start))
88-
}
89-
9090
func makeRequestLoop(url string, jsonBytes []byte) {
9191
var i int
9292
for true {

0 commit comments

Comments
 (0)