Class Timer

java.lang.Object
org.apache.jena.atlas.lib.Timer

public class Timer extends Object
A Timer of operations
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Stop timing and return the elapsed time in milliseconds
    long
    Read an elapsed timer
    long
    Read the timer - either the instantaneous value (if running) or elapsed time (if finished).
    long
    Read a running timer
     
    static long
    time(Runnable action)
    Time an operation.
    static String
    timeStr(long timeInterval)
    Helper function to format milliseconds as "%.3f" seconds

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Timer

      public Timer()
  • Method Details

    • startTimer

      public Timer startTimer()
    • endTimer

      public long endTimer()
      Stop timing and return the elapsed time in milliseconds
    • read

      public long read()
      Read the timer - either the instantaneous value (if running) or elapsed time (if finished).
    • readTimer

      public long readTimer()
      Read a running timer
    • getTimeInterval

      public long getTimeInterval()
      Read an elapsed timer
    • timeStr

      public static String timeStr(long timeInterval)
      Helper function to format milliseconds as "%.3f" seconds
    • time

      public static long time(Runnable action)
      Time an operation. Return the elapsed time in milliseconds.