Package org.modeshape.common.math

Examples of org.modeshape.common.math.Duration


     */
    public void stop() {
        if (this.isRunning()) {
            long duration = System.nanoTime() - this.lastStarted;
            this.lastStarted = 0l;
            this.stats.add(new Duration(duration));
        }
    }
View Full Code Here


    public void lap() {
        if (this.isRunning()) {
            long now = System.nanoTime();
            long duration = now - this.lastStarted;
            this.lastStarted = now;
            this.stats.add(new Duration(duration));
        }
    }
View Full Code Here

     *
     * @return the median duration, or an empty duration if this stopwatch has not been used since creation or being
     *         {@link #reset() reset}
     */
    public Duration getMedianDuration() {
        return this.detailedStats != null ? this.detailedStats.getMedian() : new Duration(0l);
    }
View Full Code Here

TOP

Related Classes of org.modeshape.common.math.Duration

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.