Class Watch

java.lang.Object
edu.fiu.jtlex.processors.Watch

public class Watch extends Object
A class for recording time intervals in seconds.
Since:
Revision 800
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a watch.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    lap()
    Calculates difference in seconds between the initial timestamp and the invocation of this method.
    void
    Starts the watch by recording the initial timestamp.
    double
    Calculates difference in seconds between the initial timestamp and the invocation of this method and deletes the initial timestamp.

    Methods inherited from class java.lang.Object

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

    • Watch

      public Watch()
      Creates a watch.
      Since:
      Revision 800
  • Method Details

    • start

      public void start()
      Starts the watch by recording the initial timestamp.
      Since:
      Revision 800
    • stop

      public double stop()
      Calculates difference in seconds between the initial timestamp and the invocation of this method and deletes the initial timestamp.
      Returns:
      The difference in seconds between the initial timestamp and the invocation of this method, or zero if there is no initial timestamp.
      Since:
      Revision 800
      See Also:
    • lap

      public double lap()
      Calculates difference in seconds between the initial timestamp and the invocation of this method.
      Returns:
      The difference in seconds between the initial timestamp and the invocation of this method, or zero if there is no initial timestamp.
      Since:
      Revision 800
      See Also: