Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Performance¶
Inherits: Object
Exposes performance-related data.
Description¶
This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the Monitor tab in the editor's Debugger panel. By using the get_monitor method of this class, you can access this data from your code.
You can add custom monitors using the add_custom_monitor method. Custom monitors are available in Monitor tab in the editor's Debugger panel together with built-in monitors.
Note: Some of the built-in monitors are only available in debug mode and will always return 0
when used in a project exported in release mode.
Note: Some of the built-in monitors are not updated in real-time for performance reasons, so there may be a delay of up to 1 second between changes.
Note: Custom monitors do not support negative values. Negative values are clamped to 0.
Methods¶
void |
add_custom_monitor ( StringName id, Callable callable, Array arguments=[] ) |
get_custom_monitor ( StringName id ) |
|
get_monitor ( Monitor monitor ) const |
|
has_custom_monitor ( StringName id ) |
|
void |
remove_custom_monitor ( StringName id ) |
Enumerations¶
enum Monitor:
Monitor TIME_FPS = 0
The number of frames rendered in the last second. This metric is only updated once per second, even if queried more often. Higher is better.
Monitor TIME_PROCESS = 1
Time it took to complete one frame, in seconds. Lower is better.
Monitor TIME_PHYSICS_PROCESS = 2
Time it took to complete one physics frame, in seconds. Lower is better.
Time it took to complete one navigation step, in seconds. This includes navigation map updates as well as agent avoidance calculations. Lower is better.
Monitor MEMORY_STATIC = 4
Static memory currently used, in bytes. Not available in release builds. Lower is better.
Monitor MEMORY_STATIC_MAX = 5
Available static memory. Not available in release builds. Lower is better.