Jump to content
Sign in to follow this  
Kogmedia

StringInStr Vs StringRegExp

Recommended Posts

Kogmedia

If StringInStr($oIE_Source,"has been removed or is no longer available.") Then

If StringRegExp($oIE_Source,"removed or is no longer available.",1) Then

Anyone have any idea which one is faster?

Edited by Kogmedia

[font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search

Share this post


Link to post
Share on other sites
WeMartiansAreFriendly

You can try a speed test.. StrInString is faster in the test for me.

$sString = 'Autoit'

For $x = 1 to 8
    ConsoleWrite('Test '&$x&@LF)
    $itime = TimerInit()
    If StringInStr($sString,'Autoit') Then ConsoleWrite(@TAB&'Str='&TimerDiff($itime)&' ms'&@lf)
    $itime = TimerInit()
    If StringRegExp($sString,'Autoit') Then ConsoleWrite(@TAB&'Reg='&TimerDiff($itime)&' ms'&@lf)
Next

Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

Share this post


Link to post
Share on other sites
Kogmedia

Thanks, I am doing a speed test but my script take 2 1/2 hours to exc :)

Thanks for your reply I will test the regex results & when it has finished parsing instring,

I didn't think of making a script to test :)


[font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×