Fbc compiler benchmark

User projects written in or related to FreeBASIC.
mrminecrafttnt
Posts: 87
Joined: Feb 11, 2013 12:23

Fbc compiler benchmark

Postby mrminecrafttnt » Dec 26, 2018 12:15

Benchmarks your FBC Compiler.. :)

Code: Select all

dim as double runtime = timer
width 120,40
color 15
locate 2,2
Print "FBCBench 0.1 - Compiled with:";__FB_VERSION__
color 7

dim as integer subnr,osubnr,defaultsubnr = 5000,setsubnr
setsubnr = val(command)
if setsubnr = 0 then setsubnr = defaultsubnr : print "Rendering Method = Default (Compile 100000 Sub)"
color 15 : print "Benching FBC Version:";
color 7
shell "fbc -version"
locate csrlin+1,1

open "Bench.bas" for output as #1
Print "Writeing Bench.bas.."
for i as integer = 1 to setsubnr
    subnr+=1
    print #1,"sub s";str(subnr)
    print #1,"print ""this is sub #";str(subnr);""""
    print #1,"end sub"
    if subnr = osubnr + 1000 then print #1,"#print subnr ";str(subnr);"/";str(defaultsubnr) : osubnr = subnr : print "subnr :";subnr
   
next
print #1,"#print compile select case stuff"
print #1,"select case str(val(command))"
for i as integer = 1 to setsubnr
    print #1,"case """;str(i);""""
    print #1,"s";str(i)
next
print #1,"case else"
    print #1,"#print write else stuff.."
for i as integer = 1 to setsubnr
    print #1,"s";str(i)
next
print #1,"end select"
print #1,"#print compile the other stuff.."
print "Closing file.."
close #1
print "compiling..";
print "STARTING BENCHMARK"
dim as double t = timer
shell "fbc Bench.bas"
print "done"
print using "FBC Bench used :####.####sec";timer-t
print using "This Run used  :####.####sec";timer-runtime
print "Press A KEY TO EXIT"
sleep

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests