多谢!

解决方案 »

  1.   


        访问timer值不行吗?
      

  2.   

    Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)Private Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
    End Type
    Private Sub Form_Load()
    Dim myTime As SYSTEMTIMEGetSystemTime myTimeMe.AutoRedraw = TrueWith myTime
    Print "当前时间:" & .wYear & "年" & .wMonth & "月" & .wDay & "日" & " " & _
          .wHour & "时" & .wMinute & "分" & .wSecond & "." & .wMilliseconds & "秒"
    End With
    End Sub
      

  3.   

    timeGettimePrivate Declare Function timeGetTime Lib "winmm.dll" () As Long
      

  4.   

    GetTickCountPublic Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long不过很耗资源的,不要在循环内使用.
      

  5.   

    你可以使用API函数TIMEGETTIME来解决问题,该函数返回一个毫秒级的整数,在你要测试的函数或操作之前使用该函数得到一个数值,在函数或操作结束后再使用该函数得到一个数值,将后面得到的数值减去前面得到的数值,就是中间所花费的毫秒数。不要使用VB自带的timer控件,该控件只能得到约0.01秒的时间值,并且还不精确,而且其自身所占用的资源过大,会影响你的实际测试结果。