I have made a program that calculates a user-specified number of random DNA base pairs. The four possible pair combinations are:

A:T
T:A
G:C
C:G

The problem comes when calculating millions of these pairs. How can I quickly calculate 10 million base pairs? With the code that I am using it takes over 15 seconds for each million base pairs as a compiled EXE. All that really needs to be calculated is the number of each kind so that I can display percentages.

So in summary I need a way to randomly choose one of these four base pairs millions of times and display totals. Thanks for any help!

Portion of code used:

Code:
    NumberofTimes = 10000000
    Randomize
    For X = 1 To NumberofTimes
        r = Int(Rnd * 8)
        If r = 0 Or r = 1 Then
            '-Base Pair A:T
            AT = AT + 1
        ElseIf r = 2 Or r = 3 Then
            '-Base Pair T:A
            TA = TA + 1
        ElseIf r = 4 Or r = 5 Then
            '-Base Pair G:C
            GC = GC + 1
        ElseIf r = 6 Or r = 7 Or r = 8 Then
            '-Base Pair C:G
            CG = CG + 1
        End If
    Next X
[Edited by overhill on 11-19-2000 at 02:37 PM]