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