Gosub or functions?

Blitz3D Forums/Blitz3D Beginners Area/Gosub or functions?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

gosubs seems faster than functions

try this code :p
[/code]
Graphics 800,600,0,2
t=MilliSecs()
For a=1 To 1000000
Gosub blah
Next
Text 0,0,MilliSecs()-t
Flip
t=MilliSecs()
For a=1 To 1000000
bloh()
Next
Text 0,10,MilliSecs()-t
Flip
WaitKey
End
.blah
Return
Function bloh()
End Function
[/code]
results are
8
12
on my system debug off

but remember that you can use the same vars in all of your functions as they are locals, in oposition of the gosub that you have to use variables that are available in the entire program, also you can't pass values with gosub, you have to put them in the vars before.