1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

runtime.nanotime

This commit is contained in:
2022-06-02 15:02:16 +08:00
parent 07273b8b31
commit 1c27b29d27
2 changed files with 29 additions and 8 deletions

View File

@ -3,6 +3,7 @@ package stopwatch_test
import (
"testing"
"time"
_ "unsafe"
"github.com/charlienet/go-mixed/stopwatch"
)
@ -28,3 +29,16 @@ func TestWatch(t *testing.T) {
watch.Restart()
}
func TestStop(t *testing.T) {
watch := stopwatch.StartNew()
time.Sleep(time.Second)
watch.Stop()
time.Sleep(time.Second)
watch.Start()
time.Sleep(time.Second)
t.Log(watch.Elapsed())
}