Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP: How to measure program execution time.
#21
Thanks, Antoni, it's a good testing template. I'm going to save it.
*****
Reply
#22
What am i? A wall? Damn you people, you go to hell and you die! Big Grin
oship me and i will give you lots of guurrls and beeea
Reply
#23
Blitz,
Please don't get upset. Your solutions and suggestions were quite precise, but perhaps more than what we needed to solve the original problem of this post. We're not timing stuff for NASA here, just trying to determine which block of code is faster than the other. Got it?
*****
Reply
#24
Upset? Me? Smile
Nah, though i sense you have no respect for my coding skills. Obviously you haven't been around very long. But i know one thing though, i'm done trying to help people. I've done it for too long and most of the time people don't listen anyway.

However, i find it amusing that you wanted (if i understood correctly) something simple and accurate. And i may be crazy here, but the code i posted is simpler, cleaner and more accurate then antonis. Yet you go with Antonis. Oh well, last time i'll try to help out.
oship me and i will give you lots of guurrls and beeea
Reply
#25
Blitz, I'm sorry you feel that way. You should not feel insulted if someone does not apppreciate your solutions. We all like different things. Yours may be the best, but I may not like it at this particular time. There's an old saying: "You can lead a horse to water, but you can't make him drink".

As far as not helping anymore. You have the talent and the gift. You should continue helping others. Just don't get upset when they don't do it exactly your way.
*****
Reply
#26
While blitz may be upset about it, moneo, his way does work most accurately, is simpler, and doesnt take as long to execute Execute the code 1000 times, and divide the result by 1000. Not only does it work on a constant system timer, but it works out speed fluxtuations.

Code:
numtimes = 1000
x = timer
for y = 0 to numtimes
  executecode()
next y
print (timer - x) / numtimes

sub executecode()
  'put contestant entry here
end sub
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#27
Blitz: You are at the heart of this thread:

You suggested Windows allowed to count milliseconds, and Tonski posted a link doing so.

Then you suggested that polling TIMER repeatedly would waste a lot of time in the loop, and I posted some source that substracted the polling time from the total time..

I think we all heard you, only we forgot to mention you in our answers...

Please excuse me if I forgot netiquette, I write a part of the posts from my job and this is not easy sometimes...
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)