原创 VB_代码执行速度测试

2009-8-17 16:54 4539 18 18 分类: 软件与OS

'**************************************
'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!


                        
                        Terms of Agreement:  
                        By using this code, you agree to the following terms... 
                        
                        1) You may use this code in your own programs (and may
                        compile it into a program and distribute it in compiled
                        format for languages that allow it) freely and with no
                        charge.  
                        2) You MAY NOT redistribute this code (for example to a
                        web site) without written permission from the original
                        author. Failure to do so is a violation of copyright
                        laws.  
                        3) You may link to this code from another website, but
                        ONLY if it is not wrapped in a frame.
                        4) You will abide by any additional copyright
                        restrictions which the author may have placed in the
                        code or code's description.


'**************************************
' Name: [ A Simple] code execution speed
'     test
' Description:Paste this into your VB co
'     de to test how long a portion of your co
'     de takes to execute. The number of milli
'     seconds is appended to C:\TimeTest.txt
' By: lonetron
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=49159&lngWId=1'for details.'**************************************


'---------------------------------------
'    
'[Simple] code execution time tests for
'     VB
'---------------------------------------
'    
'Paste this into your VB code to test ho
'     w long a portion of your
'code takes to execute. The number of mi
'     lliseconds is appended to C:\TimeTest.tx
'     t
' __________________________
'|This simple solution was
'|brought to you by the P2B Consortium.
'|揅reate your very own artificial
'|intelligence chat-bot now!?'|http://www.p2bconsortium.com/sss/Creat
'     eBot.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

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
EE直播间
更多
我要评论
0
18
关闭 站长推荐上一条 /3 下一条