再上一段测试效率的代码,完成不超过1毫秒Local $Str = _
'2010-08-04 12:58:31 :AVcc12' & @CRLF & _
'2010-08-04 12:58:34 :AVcc13' & @CRLF & _
'2010-08-04 13:03:30 :AVcc14' & @CRLF & _
'2010-08-04 13:13:43 :AVcc15' & @CRLF & _
'2010-08-04 13:34:52 :AVcc16' & @CRLF & _
'2010-08-04 13:41:25 :AVcc17' & @CRLF & _
'2010-08-04 13:54:44 :AAcc1' & @CRLF & _
'2010-08-04 14:08:19 :AAcc9' & @CRLF & _
'2010-08-04 14:09:01 :AAcc1' & @CRLF & _
'2010-08-04 14:15:27 :AVcc7' & @CRLF & _
'2010-08-04 14:16:38 :AVcc6' & @CRLF & _
'2010-08-04 14:21:39 :AVcc13' & @CRLF & _
'2010-08-04 14:22:24 :AVcc14' & @CRLF & _
'2010-08-03 12:44:16 :AVcc15' & @CRLF & _
'2010-08-04 14:31:59 :AVcc16' & @CRLF & _
'2010-08-04 14:40:54 :AVcc17' & @CRLF & _
'2010-08-04 14:42:49 :AVcc18' & @CRLF & _
'2010-08-04 16:04:30 :AVcc19' & @CRLF & _
'2010-08-04 16:18:51 :AAcc9'
Local $ts = TimerInit()
Local $sR = StringRegExp($Str, '(.+\:(.+))[\r|$]', 3), $out
For $i = 1 To UBound($sR) - 1 Step 2
If IsDeclared('_' & $sR[$i]) Then ContinueLoop
$out &= $sR[$i - 1] & @CRLF
Assign('_' & $sR[$i], 0)
Next
MsgBox(0, '耗时(ms):' & TimerDiff($ts), $out)
|