VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Simple code execution speed test

by lonetron (2 Submissions)
Category: Complete Applications
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

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

API Declarations
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function timeGetTime Lib "winmm.dll" () As Long

Rate A Simple code execution speed test

'---------------------------------------
'[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

Download this snippet    Add to My Saved Code

A Simple code execution speed test Comments

No comments have been posted about A Simple code execution speed test. Why not be the first to post a comment about A Simple code execution speed test.

Post your comment

Subject:
Message:
0/1000 characters