Class AnimationBenchmark


  • public class AnimationBenchmark
    extends java.lang.Object
    Static utility for benchmarking animations: tracks duration and frame rate of Animation instances wrapped by track(Animation).

    Enable benchmarking by setting the BON constant to true.

    • Field Detail

      • ENABLED_CONSTANT

        public static final java.lang.String ENABLED_CONSTANT
        Boolean BON constant that enables animation benchmarking. If true and a label was queued, an animation started via Animator is automatically wrapped in a AnimationBenchmark.TrackedAnimation before execution.

        Constant name: "ej.mwt.debug.animation.benchmark.enabled".

        See Also:
        Constant Field Values
    • Method Detail

      • addNextLabel

        public static void addNextLabel​(java.lang.String label)
        Queues a label to be associated with the next AnimationBenchmark.TrackedAnimation created, and sets up the synchronization lock used by wait(String, long).

        Must be called before the animation is started. Labels are consumed in FIFO order.

        Parameters:
        label - the label to associate with the next benchmarked animation
      • clear

        public static void clear()
        Resets all benchmarking state: pending labels, completion locks, and completed animations.

        Call this between test runs to ensure a clean state.