https://github.com/jojomi/minprofile
Minimal golang profiling library. Get a quick overview of where time is spent in your code.
https://github.com/jojomi/minprofile
go golang profile profiler profiling quick simple
Last synced: 6 months ago
JSON representation
Minimal golang profiling library. Get a quick overview of where time is spent in your code.
- Host: GitHub
- URL: https://github.com/jojomi/minprofile
- Owner: jojomi
- License: mit
- Created: 2017-03-14T18:24:54.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-10T16:02:05.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T01:53:07.648Z (over 1 year ago)
- Topics: go, golang, profile, profiler, profiling, quick, simple
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minprofile
Minimum golang profiling library. Get a quick overview of where time is spent in your code.
[](http://godoc.org/github.com/jojomi/minprofile) [](https://travis-ci.org/jojomi/minprofile) [](https://goreportcard.com/report/github.com/jojomi/minprofile) [](https://coveralls.io/github/jojomi/minprofile?branch=master)
## Install
go get github.com/jojomi/minprofile
## Usage
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`.
## Output
Example output from above:
PROF: Σ=1.1001571s, Δ=1.1001571s (hard task finished)
PROF: Σ=1.3501727s, Δ=250.0156ms (easy task finished)