Package org.jzonic.jlo

Source Code of org.jzonic.jlo.TimeTrackerTest

package org.jzonic.jlo;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class TimeTrackerTest extends TestCase {

  public TimeTrackerTest(String testName) {
        super(testName);
    }
   
    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }
   
    public static Test suite() {
        TestSuite suite = new TestSuite(TimeTrackerTest.class);
        return suite;
    }
 
  public void testTimeTracking() {   
    Logger logger = LogManager.getLogger("org.jzonic.jlo","simple");
        long now = System.currentTimeMillis();
    TimeTracker.start();
        for ( int i = 0; i < 10;i++) {
            logger.fatal("Hallo");
        }
        long elapsed = (System.currentTimeMillis()-now);
        System.out.println("Total time:" + elapsed + "ms" );
        double div = (double)elapsed/10.0;
        System.out.println("Time for one:"+ div*10.0 +"microseconds" );
        TimeTracker.stop();
  }
}
TOP

Related Classes of org.jzonic.jlo.TimeTrackerTest

TOP
Copyright © 2018 www.massapi.com. 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.