mirror of
https://github.com/godotengine/godot-benchmarks.git
synced 2025-12-31 09:49:13 +03:00
23 lines
356 B
GDScript
23 lines
356 B
GDScript
extends Benchmark
|
|
|
|
const ITERATIONS = 1_000_000
|
|
|
|
var number := 0
|
|
|
|
# Benchmark for loop by:
|
|
# 1) Adding a number ITERATIONS times
|
|
# 2) Calling a function ITERATIONS times
|
|
|
|
func benchmark_for_loop_add() -> void:
|
|
for i in ITERATIONS:
|
|
number += 1
|
|
|
|
|
|
func function() -> void:
|
|
pass
|
|
|
|
|
|
func benchmark_for_loop_call() -> void:
|
|
for i in ITERATIONS:
|
|
function()
|