github.com/lingyao2333/mo-zero@v1.4.1/core/stat/internal/cpu_linux_test.go (about) 1 package internal 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestRefreshCpu(t *testing.T) { 10 assert.NotPanics(t, func() { 11 RefreshCpu() 12 }) 13 } 14 15 func BenchmarkRefreshCpu(b *testing.B) { 16 for i := 0; i < b.N; i++ { 17 RefreshCpu() 18 } 19 }