mirror of https://github.com/poanetwork/gecko.git
22 lines
328 B
Go
22 lines
328 B
Go
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package timer
|
|
|
|
import (
|
|
"sync"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestTimer(t *testing.T) {
|
|
wg := sync.WaitGroup{}
|
|
wg.Add(1)
|
|
defer wg.Wait()
|
|
|
|
timer := NewTimer(wg.Done)
|
|
go timer.Dispatch()
|
|
|
|
timer.SetTimeoutIn(time.Millisecond)
|
|
}
|