-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.gd
41 lines (27 loc) · 936 Bytes
/
benchmark.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
extends Node
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
var mucho_texto = "Comenzando el benchmark... \n\n"
# test de C#
var startC = OS.get_ticks_usec()
for _i in range(50000):
CSharp_.cacafuti()
var endC = OS.get_ticks_usec()
var elapsedC = endC-startC
mucho_texto += "El proceso en C# ha tardado: " + str(elapsedC) + " microsegundos\n\n"
# test de GDScript
startC = OS.get_ticks_usec()
for _i in range(50000):
GDScript_.cacafuti()
endC = OS.get_ticks_usec()
elapsedC = endC-startC
mucho_texto += "El proceso en GDScript ha tardado: " + str(elapsedC) + " microsegundos\n\n"
# imprimiendo el texto
get_node("RichTextLabel").text = mucho_texto
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass