|
-
Aug 10th, 2002, 09:08 AM
#11
Fanatic Member
have to make some code modifications/adjustments also i ditched the module since i don't know how to make it work in .NET (highlighted the change):
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region
Declare Function GetTickCount Lib "kernel32.dll" () As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Program to test relative speed of VB6 vs VB.NET
'Tests mathematical operations
'Coded 10.8.02
Dim x As Long
Dim z As Double
Dim start As Long
MessageBox.Show("Press OK to begin mathematical operations. Tests should take <1 minute.")
start = GetTickCount
'Basic operations, integer & floating point
For x = 0 To 10000000
z = 17 + 56 / (9 * 263) - 78 / (2.2 * 9)
Next
'Rnd
For x = 0 To 1000000
z = Rnd()
Next
'Trig functions
For x = 0 To 10000000
z = System.Math.Sin(23.5687)
z = System.Math.Cos(23.5687)
z = System.Math.Tan(23.5687)
z = System.Math.Atan(23.5687)
Next
'Sqr
For x = 0 To 10000000
z = System.Math.Sqrt(2315.126)
Next
'Exp & log
For x = 0 To 10000000
z = System.Math.Exp(22.561)
z = System.Math.Log(22.561)
Next x
MessageBox.Show((GetTickCount() - start) / 1000 & " seconds elapsed.")
End Sub
End Class
Massey RuleZ! ^-^__  Cheers!  __^-^ Massey RuleZ!
Did you know that...
The probability that a random rational number has an even denominator is 1/3 (Salamin and Gosper 1972)? This result is independently verified by me (2002)!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|