edu.stanford.nlp.util
Class Timing

java.lang.Object
  extended byedu.stanford.nlp.util.Timing

public class Timing
extends Object

A class for measuring how long things take.

Author:
Christopher Manning

Method Summary
static long endTime()
          Print how long the timed operation took.
static long endTime(String str)
          Print how long the timed operation took to System.err.
static long endTime(String str, PrintStream stream)
          Print how long the timed operation took.
static void startTime()
          Start the timing operation.
static long tick()
           
static long tick(String str)
          Print how much time has passed to System.out.
static long tick(String str, PrintStream stream)
          Print how much time has passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

startTime

public static void startTime()
Start the timing operation.


endTime

public static long endTime(String str)
Print how long the timed operation took to System.err.

Parameters:
str - Additional string to be printed out at end of timing
Returns:
Number of elapsed milliseconds

endTime

public static long endTime(String str,
                           PrintStream stream)
Print how long the timed operation took.

Parameters:
str - Additional string to be printed out at end of timing
stream - PrintStream on which to write output
Returns:
Number of elapsed milliseconds

endTime

public static long endTime()
Print how long the timed operation took.

Returns:
Number of elapsed milliseconds

tick

public static long tick(String str)
Print how much time has passed to System.out. Time is measured from the last tick call, or the last call to startTime or when the class was loaded if there has been no previous call.

Parameters:
str - Prefix of string printed with time
Returns:
Number of elapsed milliseconds from tick (or start)

tick

public static long tick(String str,
                        PrintStream stream)
Print how much time has passed. Time is measured from the last tick call, or the last call to startTime or when the class was loaded if there has been no previous call.

Parameters:
str - Prefix of string printed with time
stream - PrintStream that is written to
Returns:
Number of elapsed milliseconds from tick (or start)

tick

public static long tick()


Stanford NLP Group