Bmax

BlitzMax Forums/BlitzMax Programming/Bmax

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.

I think the compiler is optimizing the a=2*2 part (maybe just converting it to a=4?).

I changed the function to the following and its run time is much closer to the non-function method:

Function sq(x#)
Return 2*2
End Function

t=MilliSecs()
Local a#

For i=0 To 10000000
a=sq(2)
Next

Print (MilliSecs()-t)