我这里有2个计时器,找高手鉴定一下哪个性能更好一点。
Option Explicit
Dim x As Long
Dim m As Long, s As Long
Dim cjlm As Long, cjls As Long
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
x = x + 1000
cjlm = Int(((x Mod 3600000) / 60000))
m = cjlm '取得分钟
cjls = Int(((x Mod 3600000) Mod 60000) / 1000)
s = cjls '取得秒种
Label1.Caption = IIf(Len(Trim(Str(m))) < 2, "0" & Trim(Str(m)), Trim(Str(m))) + ":" + IIf(Len(Trim(Str(s))) < 2, "0" & Trim(Str(s)), Trim(Str(s)))
End Sub