Skip to content

Commit 551495a

Browse files
addressing code review
1 parent 35a2f49 commit 551495a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

examples/main_profile_feature.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ const RUN_NUMBER = 50
6161

6262
func main() {
6363

64-
if ProfileMode != "" {
65-
66-
switch ProfileMode {
67-
case "mem":
68-
defer profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.MemProfileRate(1)).Stop()
69-
case "cpu":
70-
defer profile.Start(profile.CPUProfile, profile.ProfilePath(".")).Stop()
71-
}
72-
73-
for i := 0; i < RUN_NUMBER; i++ {
74-
stressTest()
75-
}
64+
switch ProfileMode {
65+
case "mem":
66+
defer profile.Start(profile.MemProfile, profile.ProfilePath("."), profile.MemProfileRate(1)).Stop()
67+
case "cpu":
68+
defer profile.Start(profile.CPUProfile, profile.ProfilePath(".")).Stop()
69+
default:
70+
log.Println("ProfileMode should be set to mem or cpu")
71+
72+
}
73+
74+
for i := 0; i < RUN_NUMBER; i++ {
75+
stressTest()
7676
}
7777

7878
}

0 commit comments

Comments
 (0)