Class Timer

java.lang.Object
edu.udel.cis.vsl.abc.util.IF.Timer

public class Timer extends Object
An object used to print how long it takes to do things.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new "do-nothing" timer.
    Constructs new timer which will print output to the given stream.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    markTime(String message)
    Prints a message which includes the amount of time (in seconds, rounded to thousandths), since the last call to markTime(), or since instantiation if this is the first such call.

    Methods inherited from class java.lang.Object

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

    • Timer

      public Timer()
      Constructs a new "do-nothing" timer. Nothing is printed, nothing is timed. Here for convenience only, so that users can say "markTime()" whenever they want.
    • Timer

      public Timer(PrintStream out)
      Constructs new timer which will print output to the given stream.
      Parameters:
      out - stream to which output should be printed
  • Method Details

    • markTime

      public void markTime(String message)
      Prints a message which includes the amount of time (in seconds, rounded to thousandths), since the last call to markTime(), or since instantiation if this is the first such call.
      Parameters:
      message - this message is inserted into the actual message that is printed. This message should be a simple verbal phrase, such as "compile program", or "preprocess source code".