how fast to 1 Billion ?

BlitzMax Forums/BlitzMax Beginners Area/how fast to 1 Billion ?

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.

Coorrae's code becomes about 10% faster if you declare a right before the loop. Looking at the assembly, this compiles to add eax,1 instead of add esi,1. I would have expected a :+ 1 to be faster too, but it compiles to the same add eax,1 (instead of inc eax, which I think would be faster).

Strict 

Local start: Int 
Local finish: Int 

Delay 500

start = MilliSecs()

Local a: Int = 0
While (a < 1000000000) 
  a = a + 1 
Wend 

finish = MilliSecs() 

Print "0 to 1 Billion in " + (finish - start) + " milliseconds"