Function timing (benchmarking, perf testing etc)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Coffea
:warning: Old Version Published before Godot 3 was released.

What would be a good way to implement a timer for function testing, benchmarking code, performance testing … that kind of thing ?

For performance testing, you can use OS.get_ticks_msec(), I wrote those micro-benchmarks using lots of iterations: https://github.com/godotengine/godot-tests/blob/master/benchmarks/zylann/gdscript_microtests.gd

Zylann | 2016-11-08 12:45

That will do it, thank you very much ^^

Coffea | 2016-11-10 17:39

I added my comment as answer, I should have done that before.

Zylann | 2016-11-10 17:47

:bust_in_silhouette: Reply From: Zylann

For performance testing, you can use OS.get_ticks_msec(), as an example I wrote those micro-benchmarks using lots of iterations: https://github.com/godotengine/godot-tests/blob/master/benchmarks/zylann/gdscript_microtests.gd