2024-02-24 16:42:26 +01:00

18 lines
633 B
GDScript

extends DebugLabel
@export var monitor: Performance.Monitor
@export var multiply := 1.0
@export var precision := 0.1
@export var suffix := ""
func _process(_delta):
match monitor:
Performance.Monitor.TIME_PROCESS, Performance.Monitor.TIME_PHYSICS_PROCESS:
text = str(snapped(Performance.get_monitor(monitor) * 1000, 0.1)) + " ms"
Performance.Monitor.RENDER_TOTAL_PRIMITIVES_IN_FRAME:
text = str(round(Performance.get_monitor(monitor) / 1000)) + "k"
Performance.Monitor.RENDER_VIDEO_MEM_USED:
text = str(round(Performance.get_monitor(monitor) / 1000000)) + " MB"
_:
text = str(Performance.get_monitor(monitor))