打印

【xnwxq】代码执行速度测试

[复制链接]
1318|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
xnwxq|  楼主 | 2009-8-23 14:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
是VB的语言!
'**************************************
'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

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

162

主题

294

帖子

1

粉丝