‘全局变量
Dim prePos As Integer
Dim preTime As Long

'timer1_tick() 内
Dim curPos As Integer
Dim time As Long
time = timeGetTime
Dim curSpeed As Integer
curSpeed = (curPos-prePos)/(time-preTime)
prePos = curPos
preTime = time

注册问题好SB answered 11 years, 11 months ago

Your Answer