Class Timing

  • All Implemented Interfaces:

    
    public final class Timing
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> T time(String name, ThrowingFn<T> fn) Times the function / closure.
      final static String graph() Graphs all the Timers that have been started since program start, or the last invocation of clearTimers.
      final static Unit clearTimers() Clears all currently running and stopped timers.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • time

         final static <T extends Any> T time(String name, ThrowingFn<T> fn)

        Times the function / closure. The time is not returned but can be graphed using the graph function.

        Parameters:
        name - The name for this timer
        fn - The function or closure to time
        Returns:

        The result of fn

      • graph

         final static String graph()

        Graphs all the Timers that have been started since program start, or the last invocation of clearTimers.

      • clearTimers

         final static Unit clearTimers()

        Clears all currently running and stopped timers. Use this to start a new timing graph.