Class SingletonStopwatchCollection


  • public class SingletonStopwatchCollection
    extends java.lang.Object
    Author:
    francesco.bariatti@irisa.fr
    • Method Summary

      Modifier and Type Method Description
      static boolean contains​(java.lang.Object key)  
      static long getElapsedMilliseconds​(java.lang.Object key)  
      static long getElapsedNanoseconds​(java.lang.Object key)  
      static long getElapsedSeconds​(java.lang.Object key)  
      static boolean isRunning​(java.lang.Object key)  
      static void printAllElapsedMilliseconds()
      Print the elapsed time in milliseconds for all stopwatches
      static void printAllElapsedNanoseconds()
      Print the elapsed time in nanoseconds for all stopwatches
      static void printAllElapsedSeconds()
      Print the elapsed time in seconds for all stopwatches
      static void restart​(java.lang.Object key)
      Restart the stopwatch associated with the given key
      static void resume​(java.lang.Object key)
      Resume the stopwatch associated with the given key.
      static void start​(java.lang.Object key)
      Start the stopwatch associated with the given key, creating it if it doesn't exist.
      static void stop​(java.lang.Object key)
      Stop the stopwatch associated with the given key
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • start

        public static void start​(java.lang.Object key)
        Start the stopwatch associated with the given key, creating it if it doesn't exist.
      • stop

        public static void stop​(java.lang.Object key)
        Stop the stopwatch associated with the given key
      • resume

        public static void resume​(java.lang.Object key)
        Resume the stopwatch associated with the given key. If no stopwatch is associated with the given key, a new one is created (in this case resume is equivalent to start).
      • restart

        public static void restart​(java.lang.Object key)
        Restart the stopwatch associated with the given key
      • contains

        public static boolean contains​(java.lang.Object key)
        Returns:
        Whether the stopwatch associated with the given key exist in this collection
      • isRunning

        public static boolean isRunning​(java.lang.Object key)
        Returns:
        Whether the stopwatch associated with the given key is running. False if there is no stopwatch associated to the key.
      • getElapsedNanoseconds

        public static long getElapsedNanoseconds​(java.lang.Object key)
        Returns:
        Elapsed nanoseconds on the stopwatch associated with the given key.
      • getElapsedMilliseconds

        public static long getElapsedMilliseconds​(java.lang.Object key)
        Returns:
        Elapsed milliseconds on the stopwatch associated with the given key.
      • getElapsedSeconds

        public static long getElapsedSeconds​(java.lang.Object key)
        Returns:
        Elapsed seconds on the stopwatch associated with the given key.
      • printAllElapsedNanoseconds

        public static void printAllElapsedNanoseconds()
        Print the elapsed time in nanoseconds for all stopwatches
      • printAllElapsedMilliseconds

        public static void printAllElapsedMilliseconds()
        Print the elapsed time in milliseconds for all stopwatches
      • printAllElapsedSeconds

        public static void printAllElapsedSeconds()
        Print the elapsed time in seconds for all stopwatches