mirror of
https://github.com/godotengine/godot-benchmarks.git
synced 2025-12-31 09:49:13 +03:00
19 lines
413 B
C#
19 lines
413 B
C#
// Similar to GDScript Array benchmarks, but using C# Array instead
|
|
|
|
public partial class Array : Benchmark
|
|
{
|
|
public void BenchmarkFillLoop()
|
|
{
|
|
int[] array = new int[10_000_000];
|
|
|
|
for(int i = 0; i < array.Length; i++)
|
|
{ array[i] = 1234; }
|
|
}
|
|
|
|
public void BenchmarkFillMethod()
|
|
{
|
|
int[] array = new int[10_000_000];
|
|
System.Array.Fill(array, 1234);
|
|
}
|
|
}
|