profiler: make the benchmark duration configurable
@@ -28,14 +28,13 @@ import (
var (
service = flag.String("service", "", "service name")
mutexProfiling = flag.Bool("mutex_profiling", false, "enable mutex profiling")
+ duration = flag.Int("duration", 600, "duration of the benchmark in seconds")
)
-const duration = time.Minute * 10
-
// busywork continuously generates 1MiB of random data and compresses it
// throwing away the result.
func busywork(mu *sync.Mutex) {
- ticker := time.NewTicker(duration)
+ ticker := time.NewTicker(time.Duration(*duration) * time.Second)
defer ticker.Stop()
for {
select {
