zoukankan      html  css  js  c++  java
  • 关于秒表

    Private Declare Function timeGetTime Lib "winmm.dll" () As Long
    Dim STARTTIME As Long

    Private Sub Command1_Click()
    STARTTIME = timeGetTime
    Timer1.Enabled = True
    End Sub

    Private Sub Form_Load()
    Label1.Caption = mytime(0)
    Timer1.Interval = 1
    Timer1.Enabled = False
    End Sub

    Private Sub Timer1_Timer()
    Label1.Caption = mytime(timeGetTime - STARTTIME)
    End Sub
    Function mytime(ByVal thetime As Long) As String
    mytime = Format(thetime Mod 1000, "000")
    thetime = thetime / 1000
    mytime = Format(TimeSerial(0, 0, thetime), "HH:MM:SS") & ":" & mytime
    End Function

    需要注意的是,TIMER控件实现的秒表精度只有55毫秒!

  • 相关阅读:
    3.2.8.1 打印与否
    3.2.8 sed 的运作
    3.2.7.1 替换细节
    3.2.7 基本用法
    3.2.6 在文本文件里进行替换
    3.2.5 程序与正则表达式
    pgm2
    pgm6
    pgm7
    pgm8
  • 原文地址:https://www.cnblogs.com/fengju/p/6336369.html
Copyright © 2011-2022 走看看