All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jamonapi.BasicNanoTimingMonitor Maven / Gradle / Ivy

There is a newer version: 2.82
Show newest version
package com.jamonapi;

/** The most basic of timing Monitors using nanosecond timing.
 * 
 * 

Sample call: *

{@code
 *  BasicTimingMonitor mon=new BasicNanoTimingMonitor();
 *  mon.start();
 *  ...code being monitored...
 *  mon.stop();
 *  }
*

**/ final public class BasicNanoTimingMonitor { // Note. this class does not implement the Monitor interface and is not used in the // rest of the monitor framework. However it can be used if performance comparable // to simple times to currentTimeMillis() are required. private long startTime; public void start() { startTime=System.nanoTime(); } public long stop() { return System.nanoTime()-startTime; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy