home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmTimer
- Caption = "Code Timing Template"
- ClientHeight = 3570
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 5685
- LinkTopic = "Form2"
- ScaleHeight = 3570
- ScaleWidth = 5685
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton cmdTest
- Caption = "Run Test"
- Height = 495
- Left = 480
- TabIndex = 5
- Top = 3000
- Width = 2295
- End
- Begin VB.Frame Frame1
- Caption = "Code Test Options"
- Height = 1335
- Left = 240
- TabIndex = 0
- Top = 360
- Width = 4935
- Begin VB.OptionButton Option2
- Caption = "Option2"
- Height = 255
- Left = 360
- TabIndex = 2
- Top = 720
- Width = 1455
- End
- Begin VB.OptionButton Option1
- Caption = "Option1"
- Height = 255
- Left = 360
- TabIndex = 1
- Top = 360
- Width = 1455
- End
- End
- Begin VB.Label lblOpt2
- Height = 255
- Left = 360
- TabIndex = 4
- Top = 2520
- Width = 4815
- End
- Begin VB.Label lblOpt1
- Height = 255
- Left = 360
- TabIndex = 3
- Top = 1920
- Width = 4815
- End
- Attribute VB_Name = "frmTimer"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdTest_Click()
- Dim Start, Finish, TotalTime
- If Option1.Value = True Then
- Start = Timer
-
- 'Put the code you wish to time
- 'here!
-
-
- 'End of Code time test
- Finish = Timer
- Else
- 'Option 2 selected
- Start = Timer
-
- 'Put the code you wish to time
- 'here!
-
-
- 'End of Code time test
- Finish = Timer
-
- End If
- TotalTime = Finish - Start ' Calculate total time.
- '
- 'Set up display results
- '
- If Option1.Value = True Then
- 'Option 1
- lblOpt1.Caption = "Total time to execute " & _
- Option1.Caption & ": " & _
- TotalTime
- Else
- 'Option 2
- lblOpt2.Caption = "Total time to execute " & _
- Option2.Caption & ": " & _
- TotalTime
- End If
-
- End Sub
-