mirror of
https://github.com/siddontang/go.git
synced 2025-04-27 13:48:51 +08:00
18 lines
216 B
Go
18 lines
216 B
Go
package timingwheel
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestTimingWheel(t *testing.T) {
|
|
w := NewTimingWheel(100*time.Millisecond, 10)
|
|
|
|
for {
|
|
select {
|
|
case <-w.After(200 * time.Millisecond):
|
|
return
|
|
}
|
|
}
|
|
}
|