Throwing caution to the wind, I decided to see if I could write my own benchmark!
Here are my criteria. Trash them if you must!
- I decided to go for a strictly command line (that is, DOS) executable to avoid the many differences between VB 6 forms and VB.NET forms.
- It seemed that Robert's benchmark fell victim to the fact that executing a tight loop a million or so times doesn't measure the right things. I decided to go for a reasonably long and difficult calculation instead.
- I incorporated a library that does I/O and can be used directly by both VB 6 and VB.NET: Scripting.FileSystemObject and an API call to GetTickCount in the "Kernel32" library for timing.
The calculation I used was the calculation of prime numbers. The program used was published on the web in the paper "A Report on Algorithms for Prime Numbers" by Mehmet Shala. (Incidental note: One of the debugging problems I had was that todays computers are so fast, I couldn't believe I was actually measuring the elapsed time of the calculation. I eventually settled on a calculation of the first 100,000 prime numbers to get a directly comparable number.)
Here's the code! It works remarkably well in both VB 6 and VB.NET!

