Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
| Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 5th, 2003, 04:14 AM
Authorized User
Join Date: Sep 2003
Location: , , .
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
Default Speed of VB for number-crunching


I am considering writing an ActiveX DLL with Visual Basic.

The DLL will perform about 5 million numeric calculations (mostly simple summations) using a small set of input data.

My question is - on a PC of about about 1 to 2 GHZ and (say) 256 MB of memory, roughly how long would 5 million computations take to complete in a VB DLL?

Is this a sensible course of action, or should I consider writing the DLL in another language (e.g. C) for significantly higher speed?

I am relatively new to VB and I have no "feel" for the speed of VB's processing.

Please give me a few pointers on this...

Many thanks.


Old September 9th, 2003, 03:03 AM
Registered User
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Take a look at this code which performs a total of 15 million simple calculations (and also 15 million simple if-then)

Private Sub Form_Load()
    Dim t As Long
    Dim a As Long
    Dim b As Long
    Dim c As Long

    a = 1
    b = 2
    c = 3

    For t = 1 To 5000000
        a = b + c
        b = a - b
        c = a + b
        If Abs(a) > 1000000 Then a = 1
        If Abs(b) > 1000000 Then b = 2
        If Abs(c) > 1000000 Then c = 3

    MsgBox "finished!"
End Sub

It takes about 2 seconds on my 866 MHz processor with 256 Mb RAM.
Old January 27th, 2005, 10:48 AM
Registered User
Join Date: Jan 2005
Location: Mumbai, Maharastra, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shahood

I am programming with visual basic and my programme is to make the pdf file i am using acrobat object for all my purpose but one spot i am stuck is

How can i add stickynotes to my pdf file
How can i add highlighted rectangle in my pdf file
How can i add stamp in my pdf file
I have tried with the jso object i am able to add fields like button and text but
unable to add the above three

Old January 27th, 2005, 12:59 PM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts


If you are using VB.NET, I have read that there is essentially no speed difference between VB.NET and C#.

If you need to interact with strings in your computations, that might really slow you down. Do you?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation For Phone Number and Mobile Number dhruthi.ram99 Javascript How-To 12 October 30th, 2011 07:24 AM
speed umeshtheone VB Databases Basics 2 May 21st, 2007 04:12 PM
speed up macro Pindacko Excel VBA 1 April 27th, 2006 01:41 PM
Number Style from word in vb DorisTan VB How-To 0 November 4th, 2004 04:29 AM
Speed kilika SQL Server 2000 10 July 1st, 2003 06:27 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.