home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / articles / vbdev / source / pin14vb3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-21  |  2.7 KB  |  109 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Simple Benchmark VB3"
  4.    ClientHeight    =   2790
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   3330
  8.    Height          =   3195
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2790
  12.    ScaleWidth      =   3330
  13.    Top             =   1140
  14.    Width           =   3450
  15.    Begin CommandButton Command5 
  16.       Caption         =   "Form Loader"
  17.       Height          =   375
  18.       Left            =   960
  19.       TabIndex        =   4
  20.       Top             =   1980
  21.       Width           =   1275
  22.    End
  23.    Begin CommandButton Command4 
  24.       Caption         =   "Read Caption"
  25.       Height          =   375
  26.       Left            =   960
  27.       TabIndex        =   3
  28.       Top             =   1560
  29.       Width           =   1275
  30.    End
  31.    Begin CommandButton Command3 
  32.       Caption         =   "Build string"
  33.       Height          =   375
  34.       Left            =   960
  35.       TabIndex        =   2
  36.       Top             =   1140
  37.       Width           =   1275
  38.    End
  39.    Begin CommandButton Command2 
  40.       Caption         =   "Double Loop"
  41.       Height          =   375
  42.       Left            =   960
  43.       TabIndex        =   1
  44.       Top             =   720
  45.       Width           =   1275
  46.    End
  47.    Begin CommandButton Command1 
  48.       Caption         =   "Long Loop"
  49.       Height          =   375
  50.       Left            =   960
  51.       TabIndex        =   0
  52.       Top             =   300
  53.       Width           =   1275
  54.    End
  55. Option Explicit
  56. Declare Function GetTickCount Lib "user" () As Long
  57. Sub Command1_Click ()
  58.     Dim dl&
  59.     Dim ctr&
  60.     dl& = GetTickCount()
  61.     For ctr& = 1 To 10000000
  62.     Next ctr&
  63.     DoEvents
  64.     MsgBox "Time: " & GetTickCount() - dl& & " ms"
  65. End Sub
  66. Sub Command2_Click ()
  67.     Dim dl&
  68.     Dim ctr#
  69.     dl& = GetTickCount()
  70.     For ctr# = 1 To 600000 Step .1
  71.     Next ctr#
  72.     DoEvents
  73.     MsgBox "Time: " & GetTickCount() - dl& & " ms"
  74. End Sub
  75. Sub Command3_Click ()
  76.     Dim dl&
  77.     Dim ctr&
  78.     Dim s$
  79.     dl& = GetTickCount()
  80.     For ctr& = 1 To 20000
  81.         s$ = s$ & "x"
  82.     Next ctr&
  83.     DoEvents
  84.     MsgBox "Time: " & GetTickCount() - dl& & " ms"
  85. End Sub
  86. Sub Command4_Click ()
  87.     Dim dl&
  88.     Dim ctr&
  89.     Dim s$
  90.     dl& = GetTickCount()
  91.     For ctr& = 1 To 40000
  92.         s$ = command4.Caption
  93.     Next ctr&
  94.     DoEvents
  95.     MsgBox "Time: " & GetTickCount() - dl& & " ms"
  96. End Sub
  97. Sub Command5_Click ()
  98.     Dim dl&
  99.     Dim ctr&
  100.     dl& = GetTickCount()
  101.     For ctr& = 1 To 100
  102.         Form2.Show
  103.         Form2.Refresh
  104.         Unload Form2
  105.     Next ctr&
  106.     DoEvents
  107.     MsgBox "Time: " & GetTickCount() - dl& & " ms"
  108. End Sub
  109.