VB icon

[ A Simple] code execution speed test

Email
Submitted on: 2/4/2015 3:19:00 AM
By: lonetron (from psc cd)  
Level: Advanced
User Rating: By 3 Users
Compatibility: VB 5.0, VB 6.0, VB Script, ASP (Active Server Pages) , VBA MS Access, VBA MS Excel
Views: 2495
 
     Paste this into your VB code to test how long a portion of your code takes to execute. The number of milliseconds is appended to C:\TimeTest.txt

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :[ A Simple] code execution speed test
'**************************************
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: [ A Simple] code execution speed test
' Description:Paste this into your VB code to test how long a portion of your code takes to execute. The number of milliseconds is appended to C:\TimeTest.txt
' By: lonetron (from psc cd)
'**************************************

'---------------------------------------
'[Simple] code execution time tests for VB
'---------------------------------------
'Paste this into your VB code to test how long a portion of your
'code takes to execute. The number of milliseconds is appended to C:\TimeTest.txt
' __________________________
'|This simple solution was
'|brought to you by the P2B Consortium.
'|“Create your very own artificial
'|intelligence chat-bot now!”
'|http://www.p2bconsortium.com/sss/CreateBot.aspx
'|__________________________
'Start Copying Here
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
'Stop Copying Here
Private Sub Form_Load()
 'Start Copying Here
 Dim tm As Long
 tm = timeGetTime
 'Stop Copying Here
 Call Sleep(5000)
 'Start Copying Here
 Dim tma As Long
 tma = timeGetTime
 Open "C:\TimeTest.txt" For Append As #1
 Print #1, tma - tm
 Close #1
 'Stop Copying Here
End Sub


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.