Class BulkTimer

java.lang.Object
com.sun.speech.freetts.util.BulkTimer

public class BulkTimer extends Object
Provides a suite of timers that are used to collect and generate performance metrics for FreeTTS.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BulkTimer
    A BulkTimer that can be used by classes that need to time their loading phase.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a bulk timer.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the timer with the given name.
    boolean
    Checks to see if we are in verbose mode.
    void
    setVerbose(boolean verbose)
    Sets verbose mode.
    void
    show(String title)
    Shows all of the collected times.
    void
    Starts the bulk timer.
    void
    start(String name)
    Starts the timer with the given name.
    void
    Stops the bulk timer.
    void
    stop(String name)
    Stops the timer with the given name.

    Methods inherited from class java.lang.Object

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

    • LOAD

      public static final BulkTimer LOAD
      A BulkTimer that can be used by classes that need to time their loading phase.
  • Constructor Details

    • BulkTimer

      public BulkTimer()
      Creates a bulk timer.
  • Method Details

    • start

      public void start(String name)
      Starts the timer with the given name. A BulkTimer can manage any number of timers. The timers are referenced by name. A timer is created the first time it is referenced.
      Parameters:
      name - the name of the timer to start
    • stop

      public void stop(String name)
      Stops the timer with the given name.
      Parameters:
      name - the name of the timer
    • start

      public void start()
      Starts the bulk timer. The BulkTimer maintains a timer for itself (called SELF). This is used to measure the overall time for a bulk timer. When timing data is displayed, the percentage of total time is displayed. The total time is the time between start and end calls on the BulkTimer .
    • stop

      public void stop()
      Stops the bulk timer.
    • setVerbose

      public void setVerbose(boolean verbose)
      Sets verbose mode.
      Parameters:
      verbose - the verbose mode
    • isVerbose

      public boolean isVerbose()
      Checks to see if we are in verbose mode.
      Returns:
      true if verbose mode; otherwise false.
    • getTimer

      public Timer getTimer(String name)
      Gets the timer with the given name.
      Parameters:
      name - the timer name
      Returns:
      the timer with that name
    • show

      public void show(String title)
      Shows all of the collected times.
      Parameters:
      title - the title for the display