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:
@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user