找回密码
 加入
搜索
楼主: xavier880819

用TimerInit 和 TimerDiff统计是时间取整的问题。

[复制链接]
 楼主| 发表于 2009-9-1 10:12:23 | 显示全部楼层
那个“10984811”是谁啊!!!这样恶意顶弄得我们的提问帖子大家都看不到了
发表于 2009-9-1 10:22:15 | 显示全部楼层
你单独运行我那段代码就知道行不行了~~

如果要加在这里也最好加在循环后
Func _test()
        Local $foo, $line, $lines, $currentRead
        $a = TimerInit()
        $zx = GUICtrlRead($xz)
        $foo = Run(@ComSpec & " /c " & 'Format ' & $zx & '/FS:FAT32/V:Haha' & $format & 'X/Y', "", @SW_HIDE, $STDOUT_CHILD)
        While 1
                $line = StdoutRead($foo)
                If @error Then ExitLoop
                GUICtrlSetData($myedit, $line, -1)
                FileWrite(@ScriptDir & "\1.txt", $line & @CRLF)
        WEnd
        _FileReadToArray(@ScriptDir & "\1.txt", $aArray2)
        For $x = 1 To $aArray2[0]
                If $aArray2[$x] = "" Then
                        _FileWriteToLine(@ScriptDir & "\1.txt", $x - $z, '', 1)
                        $z += 1
                EndIf
        Next
        $b = TimerDiff($a)
        $c = $b / 1000
        _TicksToTime(Int($b), $H, $M, $S)
        MsgBox(64, "Finish", "This format cost you  " & $H & ' Hours ' & $M & ' Minutes ' & $S & ' Seconds')
EndFunc   ;==>_test
 楼主| 发表于 2009-9-1 11:18:49 | 显示全部楼层
谢谢afan,现在倒是可以比较正常的运行了~~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-28 05:15 , Processed in 0.067254 second(s), 13 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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