找回密码
 加入
搜索
查看: 3670|回复: 7

[AU3基础] TimerInit()返回值,时间戳是怎么回事?

  [复制链接]
发表于 2010-3-13 13:42:22 | 显示全部楼层 |阅读模式
TimerInit()等系统帮助是:(以毫秒为单位)返回当前时间戳.
请大家试试如下代码:

$c = Round(TimerInit())
Sleep(1000)
$d = Round(TimerInit())
MsgBox(0,'',$c&@CRLF&$d)

比较一下c与d的值,为什么不是1000毫秒左右呢。。。
发表于 2010-3-13 13:47:08 | 显示全部楼层
$c = TimerInit()
Sleep(1000)
$d = TimerDiff($c)
MsgBox(0, '', Round($d))
 楼主| 发表于 2010-3-13 13:51:05 | 显示全部楼层
回复 2# afan


    这我知道。我主要是想看一下timerinit()的时间戳是什么样的,即然返回的是以毫秒为单位的值,那为什么隔了一秒差傎与1000毫秒相差甚远呢??
 楼主| 发表于 2010-3-13 15:02:16 | 显示全部楼层
顶一下。或许大家都很难找到答案。。。
刚在英文论坛查了会,似乎问的人很多,确没有明确的说法
姑且认为这个‘时间戳’与常用的标准时间戳有很大的差别
我用的搜索关键字:timestamp timerinit()
有位高手是这么回答的:
Posted 03 March 2010 - 07:10 PM
TimerInit is just cloning (more or less) the current windows Epoch value to an AutoIt variable. In fact, the timervalue returned is the integral millisecond value of Win epoch (which is a 100ns timer). So you can call it any number of times <g>, "restart" it without risking anyone' life. And all that free!
发表于 2010-3-13 15:59:49 | 显示全部楼层
欺负我看不明白英文
 楼主| 发表于 2010-3-13 16:08:17 | 显示全部楼层
我也不太懂。。。
哪位牛人进去转一下啊

最好能带个两种时间戳的转换程序出来研究研究
发表于 2010-3-13 16:23:17 | 显示全部楼层
这个研究主要是?
发表于 2010-3-13 21:36:46 | 显示全部楼层
间隔一般都用TimerDiff,很少用两个TimerInit的哦,不过也算误差吧
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 13:22 , Processed in 0.079461 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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