Jump to content

  • Log In with Google      Sign In   
  • Create Account


Help calculating program speed


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 01 December 1999 - 03:31 AM

What is a good way to compare the speed of algorithms in c++. For example, a simple line drawing algorithm can be written either in the classic way using y=mx+b to calculate the next point in a line or it can be done using Bresenham's Line algorithm which gets rid of the floating point math needed in the classic aproach. I would like to see which one of these algorithms will draw a line faster. How can I calculate how fast each one of these approches draws the line?

thanks


Sponsor:

#2 derwiath   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 December 1999 - 03:31 AM

I think I would time how long time it takes to draw say 100 lines with each algorithm ,calculate the average of that and then do a compare of those.
As a timer you could use the GetTickCount() win32-function. Maybe there is a better way to do the job but this is the one I can think of right now.

/Derwiath

------------------





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS