找回密码
 加入
搜索
查看: 1607|回复: 2

谁能解释一下这个执行效率上的差异?

[复制链接]
发表于 2014-2-7 14:40:12 | 显示全部楼层 |阅读模式

#NoTrayIcon

Local $aTemp = ''
Local $hTimer = 0

; Group 1
$hTimer = TimerInit()
For $a = 1 To 1000000
        If '' == $aTemp Then ContinueLoop
Next
MsgBox(0, 0, TimerDiff($hTimer))

$hTimer = TimerInit()
For $a = 1 To 1000000
        If '' = $aTemp Then ContinueLoop
Next
MsgBox(0, 0, TimerDiff($hTimer))

; Group 1
$hTimer = TimerInit()
For $a = 1 To 1000000
        If 1 == 1 Then ContinueLoop
Next
MsgBox(0, 0, TimerDiff($hTimer))

$hTimer = TimerInit()
For $a = 1 To 1000000
        If 1 = 1 Then ContinueLoop
Next
MsgBox(0, 0, TimerDiff($hTimer))

Exit


对于不同数据类型的比较,答案明显不同,求解
发表于 2014-2-7 16:05:59 | 显示全部楼层
LZ厉害
我试验果然效率不同哦, == 就是比 = 快
不懂啊
发表于 2014-2-8 07:47:26 | 显示全部楼层
不要比较,你运行其中之一几次看看怎样比较。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 15:19 , Processed in 0.074024 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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