Package com.sun.speech.freetts.util
Class Timer
java.lang.Object
com.sun.speech.freetts.util.Timer
Keeps track of execution times.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the current time.static voidThe main program for performing simple tests.voidreset()Resets the timer as if it has never run before.voidShows timing stats.voidshowTimes(long overall) Shows timing stats.voidshowTimesLong(long overall) Shows detailed timing stats.voidshowTimesShort(long overall) Shows brief timing stats.static voidshowTimesShortTitle(String title) Shows the timing stats title.voidstart()Starts the timer running.voidstop()Stops the timer.voidstop(boolean verbose) Stops the timer.
-
Constructor Details
-
Timer
Creates a timer.- Parameters:
name- the name of the timer
-
-
Method Details
-
reset
public void reset()Resets the timer as if it has never run before. -
start
public void start()Starts the timer running. -
getCurrentTime
public long getCurrentTime()Returns the current time.- Returns:
- the current time
-
stop
public void stop(boolean verbose) Stops the timer.- Parameters:
verbose- iftrue, print out details from this run; otherwise, don't print the details
-
stop
public void stop()Stops the timer. -
showTimesLong
public void showTimesLong(long overall) Shows detailed timing stats. If overall is non-zero, it represents the overall processing time and a percentage of overall time for this timer should be calculated and displayed.- Parameters:
overall- the overall processing time in milliseconds or 0.
-
showTimesShortTitle
Shows the timing stats title.- Parameters:
title- shows the title and column headings for the time display
-
showTimesShort
public void showTimesShort(long overall) Shows brief timing stats. If overall is non-zero, it represents the overall processing time and a percentage of overall time for this timer should be calculated and displayed.- Parameters:
overall- the overall processing time in milliseconds or 0.
-
showTimes
public void showTimes(long overall) Shows timing stats. If overall is non-zero, it represents the overall processing time and a percentage of overall time for this timer should be calculated and displayed.- Parameters:
overall- the overall processing time in milliseconds or 0.
-
showTimes
public void showTimes()Shows timing stats. No overall percentage is shown with this method. -
main
The main program for performing simple tests. Creates a timer uses it and shows its output.- Parameters:
args- program arguments (not used)
-