Skip to content

Instantly share code, notes, and snippets.

@jonathanhecl
Created November 27, 2023 15:50
Show Gist options
  • Save jonathanhecl/6e245bfdcb0d77bed0ae3068668f8c08 to your computer and use it in GitHub Desktop.
Save jonathanhecl/6e245bfdcb0d77bed0ae3068668f8c08 to your computer and use it in GitHub Desktop.
GDScript vs C#
GDScript:
func _ready() -> void:
var begin = OS.get_ticks_usec()
var sum = 0;
for i in range(0, 100):
sum += 1
print(sum)
var end = OS.get_ticks_usec()
print(end - begin)
C#:
public override void _Ready()
{
var begin = OS.GetTicksUsec();
var sum = 0;
for (var i = 0; i < 100; i++)
sum += 1;
GD.Print(sum);
var end = OS.GetTicksUsec();
GD.Print($"Elapsed> {end - begin}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment