Active Forums > Programs

Benchmark_01

(1/1)

bplus:
Can someone verify this code is correct and it takes under .5 secs to run, Aurel doesn't believe it.
http://basic4all.epizy.com/index.php?topic=21.0


--- Code: QB64: ---start = Timer(.001)Dim n As Long, r As DoubleFor n = 1 To 100000000    r = n * 2 - Sin(88)Next n&Print Timer(.001) - start; "seconds" 
 

BTW oddly it does better with Double than with Single default.

jack:
it times at .25 seconds on my PC
but as a benchmark it's lame, a good compiler will eliminate the loop entirely and therefore give a meaningless result

bplus:
Thank you Jack! Keybonic Plague also gets way better time than I with optimized QB64 dev 2.1

I know it's lame I didn't make it up just comparing times with other PL's and Basic's.

So I didn't screw up, it's possible to get under .5 secs.

jack:
I meant no offense to you bplus, I know who came up with the code
but if you want to do a benchmark you need to do some computations that can't be optimized out and print the result for verification

Richard Frost:
4.07s on my ancient machine.

Navigation

[0] Message Index

Go to full version