找回密码
 加入
搜索
查看: 2455|回复: 3

[系统综合] 获取系统启动后经过的毫秒数

[复制链接]
发表于 2010-2-16 19:36:18 | 显示全部楼层 |阅读模式
#Include <WinAPIEx.au3>
_WinAPI_GetTickCount()

这个API使用方法是?
发表于 2010-2-16 20:51:49 | 显示全部楼层
不好意思,虽说是翻译的人,我也没仔细看,过几天琢磨出来再回答
发表于 2010-2-16 22:52:20 | 显示全部楼层
$Ret = DllCall("kernel32.dll", "long", "GetTickCount")
If IsArray($Ret) Then
        $day = ""
        $msec = StringRight("00" & mod($Ret[0], 1000), 3)
        $uptime = floor($Ret[0] / 1000)
        $sec = StringRight("00" & mod($uptime, 60), 2)
        If $uptime >= 60 Then
                $uptime = floor($uptime / 60)
                $min = StringRight("00" & mod($uptime, 60), 2)
                If $uptime >= 60 Then
                        $uptime = floor($uptime / 60)
                        $hour = StringRight("00" & mod($uptime, 24), 2)
                        If $uptime >= 24 Then
                                $day = floor($uptime / 24) & "天"
                        EndIf
                EndIf
        EndIf
        MsgBox(0, "系统已启动:", $day & $hour & "小时" & $min & "分钟" & $sec & "秒" & $msec & "毫秒")
EndIf

供参考,_WinAPI_GetTickCount()返回的应该就是上面的$Ret[0]
发表于 2010-2-17 02:38:33 | 显示全部楼层
#include <WinAPIEx.au3>
#include <Date.au3>
$timer = _WinAPI_GetTickCount()
Local $Hour, $Mins, $Secs
_TicksToTime($timer, $Hour, $Mins, $Secs)
MsgBox(0, "_WinAPI_GetTickCount", $Hour & "时" & $Mins & "分" & $Secs & "秒")
$timer2 = _Date_Time_GetTickCount()
Local $Hour2, $Mins2, $Secs2
_TicksToTime($timer2, $Hour2, $Mins2, $Secs2)
MsgBox(0, "_Date_Time_GetTickCount", $Hour2 & "时" & $Mins2 & "分" & $Secs2 & "秒")
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-20 12:02 , Processed in 0.077808 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表