Package com.firefly.utils.time.wheel

Examples of com.firefly.utils.time.wheel.TimeWheel


public class TestTimerWheel {
  @Test
  public void test() {
//    log.debug("test timer wheel");
    TimeWheel t = new TimeWheel();
    t.start();
    final long start = System.currentTimeMillis();
    t.add(1500, new Runnable() {

      @Override
      public void run() {
        long end = System.currentTimeMillis();
//        log.info("ttt1: " + (end - start));
        Assert.assertThat((end - start), greaterThanOrEqualTo(1500L));
      }
    });

    t.add(2500, new Runnable() {

      @Override
      public void run() {
        long end = System.currentTimeMillis();
//        log.info("ttt2: " + (end - start));
View Full Code Here

TOP

Related Classes of com.firefly.utils.time.wheel.TimeWheel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.