diff options
Diffstat (limited to 'internal/flamegraph/flamegraph.go')
| -rw-r--r-- | internal/flamegraph/flamegraph.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/flamegraph/flamegraph.go b/internal/flamegraph/flamegraph.go index cf1284e..9214f49 100644 --- a/internal/flamegraph/flamegraph.go +++ b/internal/flamegraph/flamegraph.go @@ -8,6 +8,7 @@ import ( "os" "path" "strings" + "time" ) type counter struct { @@ -55,11 +56,12 @@ func (f Flamegraph) Start(ctx context.Context) { default: select { case <-ctx.Done(): + defer close(f.Done) fmt.Println("Flamegraph processed last event") f.dump() - close(f.Done) return default: + time.Sleep(time.Millisecond * 10) } } } |
