Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.26 KB

performance_statistics.rst

File metadata and controls

39 lines (30 loc) · 1.26 KB

Performance Statistics

images/performance_statistics.png

Arcade includes performance monitoring tools to help you optimize your game. This example demonstrates the following performance api features:

If you do not want to display graphs in your game window, you can use :func:`arcade.print_timings` to print out the count and average time for all dispatched events with the function. The output looks like this:

Event          Count Average Time
-------------- ----- ------------
on_activate        1       0.0000
on_resize          1       0.0000
on_show            1       0.0000
on_update         59       0.0000
on_expose          1       0.0000
on_draw           59       0.0021
on_mouse_enter     1       0.0000
on_mouse_motion  100       0.0000

See :ref:`perf_info_api` for more information about the performance api.

.. literalinclude:: ../../arcade/examples/performance_statistics.py
    :caption: performance_statistics.py
    :linenos:
    :emphasize-lines: 43-45, 114-141, 152-157, 164-166