2014-01-09 12:37:01 +08:00
|
|
|
package timingwheel
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestTimingWheel(t *testing.T) {
|
2014-04-15 16:37:22 +08:00
|
|
|
w := NewTimingWheel(100*time.Millisecond, 10)
|
2014-01-09 12:37:01 +08:00
|
|
|
|
|
|
|
for {
|
|
|
|
select {
|
2014-04-15 16:37:22 +08:00
|
|
|
case <-w.After(200 * time.Millisecond):
|
2014-01-09 12:37:01 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|