Minimum golang profiling library. Get a quick overview of where time is spent in your code.
go get github.com/jojomi/minprofile
import (
"github.com/jojomi/minprofile"
)
p := minprofile.NewStarted()
time.Sleep(1100 * time.Millisecond) // actually here should be your application code
p.StepP("hard task finished")
time.Sleep(250 * time.Millisecond) // actually here should be your application code
p.StepP("easy task finished")
Default output channel is os.Stdout
, but can be configured using Profile.OutputWriter
.
Example output from above:
PROF: Σ=1.1001571s, Δ=1.1001571s (hard task finished)
PROF: Σ=1.3501727s, Δ=250.0156ms (easy task finished)