Class Timer

java.lang.Object
jcuda.utils.Timer

public class Timer extends Object
Simple timer functionality, similar to the CUTIL timer functions
  • Method Details

    • createTimer

      public static void createTimer(Object name)
      Creates a new timer with the given name
      Parameters:
      name - The name of the timer
    • deleteTimer

      public static void deleteTimer(Object name)
      Deletes the timer with the given name
      Parameters:
      name - The name of the timer
    • startTimer

      public static void startTimer(Object name)
      Start the timer with the given name
      Parameters:
      name - The name of the timer
    • stopTimer

      public static void stopTimer(Object name)
      Stop the timer with the given name
      Parameters:
      name - The name of the timer
    • resetTimer

      public static void resetTimer(Object name)
      Reset the timer with the given name
      Parameters:
      name - The name of the timer to reset
    • getTimerValue

      public static int getTimerValue(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(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.
      Parameters:
      name - The name of the timer
      Returns:
      The average timer value
    • prettyPrint

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

      public static String createPrettyString()
      Creates a "pretty" String containing a summary of all timers that currently exist.
      Returns:
      A pretty summary