RAND very slow

BlitzMax Forums/BlitzMax Programming/RAND very slow

Something I do is just do one call to Rnd() per game loop (unless its noticable during play) and then multiply when I need a range. Much faster. Like this:
SuperStrict

Local blah%
Local now%=MilliSecs()
For Local f%= 1 To 100000
	blah = Rand(0,f)
Next
now = MilliSecs()-now
Print now

now%=MilliSecs()
Local myrnd# = Rnd(0,1)
For Local f%= 1 To 100000
	blah = myrnd*f
Next
now = MilliSecs()-now
Print now

Admittedly, it's not always possible to work like this, but you can at least reduce the number of times you call Rnd/Rand.