Skip to content

Instantly share code, notes, and snippets.

@RichardEllicott
Created November 27, 2019 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichardEllicott/ee09d45cea8fd63a720b55c5af783f50 to your computer and use it in GitHub Desktop.
Save RichardEllicott/ee09d45cea8fd63a720b55c5af783f50 to your computer and use it in GitHub Desktop.
func _ready():
print("start tests...")
var dispose # i put this here, to prevent some clever compiler from realising these values are not used
var start_time = OS.get_ticks_msec()
for i in range(1,1000000):
dispose = 15629/i
var total_time = OS.get_ticks_msec() - start_time
print('interger division time: ', total_time)
start_time = OS.get_ticks_msec()
for i in range(1,1000000):
dispose = 15629.0/i
total_time = OS.get_ticks_msec() - start_time
print('float division time:: ', total_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment