Package com.sun.speech.freetts.util
Class Timer
- java.lang.Object
-
- com.sun.speech.freetts.util.Timer
-
public class Timer extends java.lang.Object
Keeps track of execution times.
-
-
Constructor Summary
Constructors Constructor Description Timer(java.lang.String name)
Creates a timer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCurrentTime()
Returns the current time.static void
main(java.lang.String[] args)
The main program for performing simple tests.void
reset()
Resets the timer as if it has never run before.void
showTimes()
Shows timing stats.void
showTimes(long overall)
Shows timing stats.void
showTimesLong(long overall)
Shows detailed timing stats.void
showTimesShort(long overall)
Shows brief timing stats.static void
showTimesShortTitle(java.lang.String title)
Shows the timing stats title.void
start()
Starts the timer running.void
stop()
Stops the timer.void
stop(boolean verbose)
Stops the timer.
-
-
-
Method Detail
-
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
public static void showTimesShortTitle(java.lang.String title)
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
public static void main(java.lang.String[] args)
The main program for performing simple tests. Creates a timer uses it and shows its output.- Parameters:
args
- program arguments (not used)
-
-