Package avrobase

Examples of avrobase.TimestampGenerator


* Time: 11:22:39 AM
*/
public class TimestampGeneratorTest {
  @Test
  public void testInvertedTimestamp() {
    TimestampGenerator generator = new TimestampGenerator();
    long last = generator.getInvertedTimestamp();
    long start = last;
    long startms = System.currentTimeMillis();
    System.out.println(last);
    for (int i = 0; i < 100000; i++) {
      long timestamp = generator.getInvertedTimestamp();
      assertTrue(timestamp < last);
      last = timestamp;
    }
    System.out.println(start - generator.getInvertedTimestamp());
    System.out.println(System.currentTimeMillis() - startms);
  }
View Full Code Here


    System.out.println(System.currentTimeMillis() - startms);
  }

  @Test
  public void testTimestamp() {
    TimestampGenerator generator = new TimestampGenerator();
    long last = generator.getTimestamp();
    long start = last;
    long startms = System.currentTimeMillis();
    System.out.println(last);
    for (int i = 0; i < 100000; i++) {
      long timestamp = generator.getTimestamp();
      assertTrue(timestamp > last);
      last = timestamp;
    }
    System.out.println(generator.getTimestamp() - start);
    System.out.println(System.currentTimeMillis() - startms);
  }
View Full Code Here

TOP

Related Classes of avrobase.TimestampGenerator

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.