Class CallsCounter


  • public class CallsCounter
    extends java.lang.Object
    This class counts how many times it was called per second. This can be really useful to profile whether a certain block of code is being executed too often. Usage: private static CallsCounter counter; public void someMethod() { if (counter == null) { counter = new CallsCounter("someMethod"); } counter.Update(); // some method's code... }
    Since:
    TotalCross 4.2
    • Constructor Summary

      Constructors 
      Constructor Description
      CallsCounter​(java.lang.String identifier)
      Creates a new CallsCounter object with the given identifier.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void Update()  
      • Methods inherited from class java.lang.Object

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

      • CallsCounter

        public CallsCounter​(java.lang.String identifier)
        Creates a new CallsCounter object with the given identifier.
        Parameters:
        identifier - text attached to the regular calls/s reports
    • Method Detail

      • Update

        public void Update()