Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic

Which is faster? VB 6 or VB.NET?

By Dan Mabbutt, About.com

5 of 8

The Benchmark Code - Part 1

~~~~~~~~~~~~~~~~~~~~~~~~~

Option Strict Off
Option Explicit On
Module PrimeCalc
   Private Declare Function _
   GetTickCount Lib "Kernel32" () As Integer
   Public Sub Main()
      Const MaxPrimesStored As Long = 1000000
      Dim PrimesFound As Long
      Dim Primes(MaxPrimesStored) As Double
      Dim filesys, testfile
      filesys = _
      CreateObject( _
      "Scripting.FileSystemObject")
      testfile = filesys.OpenTextFile( _
      "perftestfile.txt", 8, True)
      Dim lngStart As Double
      Dim lngFinish As Double
      Dim lngElapsed As Double
      lngStart = 0
      lngStart = GetTickCount
      testfile.writeline(lngStart)
      Dim n As Long
   Dim NumberToTest As Double
   Dim Remainder As Double
      Dim x As Long
      Dim Factor As Integer

Explore Visual Basic

By Category

About.com Special Features

Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Opinions and Humor
  5. A benchmark investigation into the relative performance speed of VB 6 versus VB.NET

©2009 About.com, a part of The New York Times Company.

All rights reserved.