Class PerfTest.Function

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int id  
    • Constructor Summary

      Constructors 
      Constructor Description
      Function()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void call()
      Subclasses should implement this method to do the action to be measured if the action is thread-safe
      void call​(int i)
      Subclasses should implement this method if the action is not thread-safe
      long getEventsPerIteration()
      Subclasses may implement this method to return either positive or negative integer indicating the number of events in a single call to this object's call() method.
      int getID()  
      long getOperationsPerIteration()
      Subclasses may implement this method to return positive integer indicating the number of operations in a single call to this object's call() method.
      void init()
      init is called each time before looping through call
      void setID​(int id)  
      long time​(long n)
      Call call() n times in a tight loop and return the elapsed milliseconds.
      • Methods inherited from class java.lang.Object

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

      • id

        private int id
    • Constructor Detail

      • Function

        public Function()
    • Method Detail

      • call

        public void call()
        Subclasses should implement this method to do the action to be measured if the action is thread-safe
      • call

        public void call​(int i)
        Subclasses should implement this method if the action is not thread-safe
      • getOperationsPerIteration

        public long getOperationsPerIteration()
        Subclasses may implement this method to return positive integer indicating the number of operations in a single call to this object's call() method. If subclasses do not override this method, the default implementation returns 1.
      • getEventsPerIteration

        public long getEventsPerIteration()
        Subclasses may implement this method to return either positive or negative integer indicating the number of events in a single call to this object's call() method. If subclasses do not override this method, the default implementation returns -1, indicating that events are not applicable to this test. e.g: Number of breaks / iterations for break iterator
      • time

        public final long time​(long n)
        Call call() n times in a tight loop and return the elapsed milliseconds. If n is small and call() is fast the return result may be zero. Small return values have limited meaningfulness, depending on the underlying VM and OS.
      • init

        public void init()
        init is called each time before looping through call
      • getID

        public final int getID()
      • setID

        public final void setID​(int id)