jcuda.utils
Class Timer

java.lang.Object
  extended by jcuda.utils.Timer

public class Timer
extends java.lang.Object

Simple timer functionality, similar to the CUTIL timer functions


Method Summary
static java.lang.String createPrettyString()
          Creates a "pretty" String containing a summary of all timers that currently exist.
static void createTimer(java.lang.Object name)
          Creates a new timer with the given name
static void deleteTimer(java.lang.Object name)
          Deletes the timer with the given name
static int getAverageTimerValue(java.lang.Object name)
          Returns the average time in milliseconds for the timer, which is the total time for the timer divided by the number of completed (stopped) runs the timer has made.
static int getTimerValue(java.lang.Object name)
          Returns the total time in milliseconds of all runs since the creation or the last reset.
static void prettyPrint()
          Pretty print a summary of all timers that currently exist
static void resetTimer(java.lang.Object name)
          Reset the timer with the given name
static void startTimer(java.lang.Object name)
          Start the timer with the given name
static void stopTimer(java.lang.Object name)
          Stop the timer with the given name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTimer

public static void createTimer(java.lang.Object name)
Creates a new timer with the given name

Parameters:
name - The name of the timer

deleteTimer

public static void deleteTimer(java.lang.Object name)
Deletes the timer with the given name

Parameters:
name - The name of the timer

startTimer

public static void startTimer(java.lang.Object name)
Start the timer with the given name

Parameters:
name - The name of the timer

stopTimer

public static void stopTimer(java.lang.Object name)
Stop the timer with the given name

Parameters:
name - The name of the timer

resetTimer

public static void resetTimer(java.lang.Object name)
Reset the timer with the given name

Parameters:
name - The name of the timer to reset

getTimerValue

public static int getTimerValue(java.lang.Object name)
Returns the total time in milliseconds of all runs since the creation or the last reset.

Parameters:
name - The name of the timer
Returns:
The time

getAverageTimerValue

public static int getAverageTimerValue(java.lang.Object name)
Returns the average time in milliseconds for the timer, which is the total time for the timer divided by the number of completed (stopped) runs the timer has made. This excludes the current running time if the timer is currently running.

Returns:
The average timer value

prettyPrint

public static void prettyPrint()
Pretty print a summary of all timers that currently exist


createPrettyString

public static java.lang.String createPrettyString()
Creates a "pretty" String containing a summary of all timers that currently exist.

Returns:
A pretty summary