github.com/lingyao2333/mo-zero@v1.4.1/core/prof/profiler_test.go (about) 1 package prof 2 3 import ( 4 "testing" 5 6 "github.com/lingyao2333/mo-zero/core/utils" 7 ) 8 9 func TestProfiler(t *testing.T) { 10 EnableProfiling() 11 Start() 12 Report("foo", ProfilePoint{ 13 ElapsedTimer: utils.NewElapsedTimer(), 14 }) 15 } 16 17 func TestNullProfiler(t *testing.T) { 18 p := newNullProfiler() 19 p.Start() 20 p.Report("foo", ProfilePoint{ 21 ElapsedTimer: utils.NewElapsedTimer(), 22 }) 23 }