Package adams.core

Class SimpleTimer


  • public class SimpleTimer
    extends Object
    Simple class for generating timings.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • SimpleTimer

        public SimpleTimer()
        Initializes the timer.
    • Method Detail

      • reset

        public void reset()
        Resets the start time.
      • expand

        public String expand​(Object obj,
                             String template)
        Expands the placeholders in the template and returns the generated string.
        Parameters:
        obj - the object's class to prefix the template with
        template - the template string
        Returns:
        the expanded string
      • expand

        public String expand​(Class cls,
                             String template)
        Expands the placeholders in the template and returns the generated string.
        Parameters:
        cls - the class to prefix the template with
        template - the template string
        Returns:
        the expanded string
      • expand

        public String expand​(String template)
        Expands the placeholders in the template and returns the generated string.
        Parameters:
        template - the template string
        Returns:
        the expanded string
      • println

        public void println​(Object obj,
                            String template)
        Expands the placeholders in the template and outputs the generated string on stdout.
        Parameters:
        obj - the object's class to prefix the template with
        template - the template string
      • println

        public void println​(Class cls,
                            String template)
        Expands the placeholders in the template and outputs the generated string on stdout.
        Parameters:
        cls - the class to prefix the template with
        template - the template string
      • println

        public void println​(String template)
        Expands the placeholders in the template and outputs the generated string on stdout.
        Parameters:
        template - the template string
      • getSingleton

        public static SimpleTimer getSingleton()
        Returns the global singleton.
        Returns:
        the singleton