How to write a benchmark??

Miscellaneous Forums/General Discussion/How to write a benchmark??

How can i simply/best way write a benchmark program to compare,
Blitz3d,Blitzmax,VC++,Game engines etc..

To compare performance,fps etc..

/Alienforce

Find out how to record the start time in millisecs, do the code, get the endtime in miisecs - starttime and display (or output to a file).

Now the code bit, don't just do each function once or it'll be too quick, you need to do it several times, e.g. 10 or 100 (depending on function speed).

Try writing a simple for loop of 100,000 or so and see how long that takes. Then try doing something in the for loop like maths. Try a copy of bytes or ints from one location to another (do each byte/int copy individually in a loop rather than using a bulk/batch command). Try copying lots of data to the video card for a benchmark. Also do from video to memory as a separate memory card. Then think up more ideas!

Same as Grey Alien, but then try to make it as overwhelmed as possible - lots of reading/writing ints, strings, bytes, and floats, and lots of math. Also try doing a For...Next loop, and doing something fairly simple within it, but doing it 500 or 5000 times.