Sign in to follow this  
Followers 0
Mithrandir

Which is more precise? TimerDiff or _Timer_Diff?

4 posts in this topic

I want to test whether using StringSplit or _StringExplode is faster but on initial tests if I use _Timer_Init and _Timer_Diff it shows _StringExplode is faster (0.17 miliseconds against 0.20 of StringSplit) but if I use TimerInit and TimerDiff it shows that StringSplit is faster. Which of the two UDFs is more accurate? Or should I take an average?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

I cannot see you getting those same results every time, and .03 milliseconds it not really much to worry about.

Personally, I always use the native built in functions where I can.

Ok, actually my purpose is not the difference between stringsplit and stringexplode, what I would like to know is the difference of time between using a regular expression to extract substrings from a string or using stringsplit and then travel in the array to take the value that I want. And since with a simple comparison timerdiff and _timer_diff showed contradictory results, I didn't know what to use. Anyway I can take both and make an average I suppose.

Edited by Mithrandir

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

"Which is more precise? TimerDiff or _Timer_Diff?"

TimerDiff(), as it has less native autoit code overhead to contend with.

But considering TimerInit() and TimerDiff() are directly related to the CPU tick frequency ... your generally better off running a longer timed/looped test. In which case it really don't matter if you use the native TimerDiff() or the Timer.UDF _Timer_Diff().

(TimerInit(), if your really like to go nuts on the subject ... :x )

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

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  
Followers 0