Private Declare Function GetTickCount Lib "kernel32" () As Long Private Sub Timer1_Timer() minute = (GetTickCount - hour * 60 * 60 * 1000) \ 1000 \ 60 second = (GetTickCount - Val(Label1.Caption) * 60 * 60 * 1000 - Val(Label2.Caption) * 60 * 1000) \ 1000
利用Api函数计算Windows从启动后所运行的总时间
Dim hour As Integer
Dim minute As Integer
Dim second As Integer
hour = GetTickCount \ 1000 \ 60 \ 60
Label1.Caption = Str(hour) + "小时"
Label2.Caption = Str(minute) + "分钟"
Label3.Caption = Str(second) + "秒钟"
End Sub
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073










