Class JavaTimer

  • All Implemented Interfaces:
    java.io.Serializable, UimaTimer

    public class JavaTimer
    extends java.lang.Object
    implements UimaTimer
    Simple implementation of UimaTimer using System.currentTimeMillis().
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long end  
      private static long serialVersionUID  
      private long start  
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaTimer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getDuration()
      Gets the time between the last call to stopIt() and the last call to startIt().
      int getResolution()
      Gets the timer resolution in milliseconds.
      private long getTime()  
      long getTimeInMicros()
      Gets the current time in microseconds.
      long getTimeInMillis()
      Gets the current time in milliseconds.
      long getTimeInSecs()
      Gets the current time in seconds.
      long startIt()
      Starts the timer.
      long stopIt()
      Stops the timer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • start

        private long start
      • end

        private long end
    • Constructor Detail

      • JavaTimer

        public JavaTimer()
    • Method Detail

      • startIt

        public long startIt()
        Description copied from interface: UimaTimer
        Starts the timer.
        Specified by:
        startIt in interface UimaTimer
        Returns:
        the current time in milliseconds
      • stopIt

        public long stopIt()
        Description copied from interface: UimaTimer
        Stops the timer.
        Specified by:
        stopIt in interface UimaTimer
        Returns:
        the current time in milliseconds
      • getResolution

        public int getResolution()
        Description copied from interface: UimaTimer
        Gets the timer resolution in milliseconds.
        Specified by:
        getResolution in interface UimaTimer
        Returns:
        the timer resolution in milliseconds
      • getDuration

        public long getDuration()
        Description copied from interface: UimaTimer
        Gets the time between the last call to stopIt() and the last call to startIt().
        Specified by:
        getDuration in interface UimaTimer
        Returns:
        the duration in milliseconds
      • getTimeInSecs

        public long getTimeInSecs()
        Description copied from interface: UimaTimer
        Gets the current time in seconds.
        Specified by:
        getTimeInSecs in interface UimaTimer
        Returns:
        the current time in seconds
      • getTimeInMillis

        public long getTimeInMillis()
        Description copied from interface: UimaTimer
        Gets the current time in milliseconds.
        Specified by:
        getTimeInMillis in interface UimaTimer
        Returns:
        the current time in milliseconds
      • getTimeInMicros

        public long getTimeInMicros()
        Description copied from interface: UimaTimer
        Gets the current time in microseconds.
        Specified by:
        getTimeInMicros in interface UimaTimer
        Returns:
        the current time in microseconds
      • getTime

        private long getTime()