Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

Help calculating program speed

This topic is 6586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites