Example usage for org.jfree.data.time FixedMillisecond FixedMillisecond

List of usage examples for org.jfree.data.time FixedMillisecond FixedMillisecond

Introduction

In this page you can find the example usage for org.jfree.data.time FixedMillisecond FixedMillisecond.

Prototype

public FixedMillisecond() 

Source Link

Document

Constructs a millisecond based on the current system time.

Usage

From source file:org.jfree.data.time.FixedMillisecondTest.java

/**
 * Serialize an instance, restore it, and check for equality.
 *///w ww.j  a v  a2  s  .c  o m
@Test
public void testSerialization() {
    FixedMillisecond m1 = new FixedMillisecond();
    FixedMillisecond m2 = (FixedMillisecond) TestUtilities.serialised(m1);
    assertEquals(m1, m2);
}

From source file:org.jfree.chart.demo.PerformanceTest1.java

public static void main4(String as[]) {
    TimeSeries timeseries = new TimeSeries("Test");
    timeseries.setMaximumItemCount(4000);
    FixedMillisecond fixedmillisecond = new FixedMillisecond();
    for (int i = 0; i < 40000; i++) {
        long l = System.currentTimeMillis();
        for (int j = 0; j < 400; j++) {
            fixedmillisecond = (FixedMillisecond) fixedmillisecond.next();
            timeseries.add(fixedmillisecond, Math.random());
        }/*from   w ww  . j  av  a  2s .co  m*/

        long l1 = System.currentTimeMillis();
        System.out.println(i + " --> " + (l1 - l) + " (" + Runtime.getRuntime().freeMemory() + " / "
                + Runtime.getRuntime().totalMemory() + ")");
    }

}