File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import (
3131const _numConcurrent = 5
3232const _numRequestsPerThread = - 1
3333const _requestDelay = 0 * time .Second
34- const _num_main_loops = 10
34+ const _numMainLoops = 10
3535
3636var _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+
4356func 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-
9090func makeRequestLoop (url string , jsonBytes []byte ) {
9191 var i int
9292 for true {
You can’t perform that action at this time.
0 commit comments