I wanted to calcualte the execution time of Bubble sort or for that matter any loop . i tried using the clock funtion in c but it gives me 0 seconds for even 10000 elemnts being in the list :sad: .
ultra vires
0
Junior Poster in Training
Recommended Answers
Jump to Postunless you're running a prehistoric computer, 10000 is nothing :) you want to be thinking in terms of millions if you wish to obtain a calculatable time difference.
Jump to Post>i guess printf doest take a lot of processing :|
printf doesn't do much internal processing, despite the length of the code for it. ;) The performance hits come from writing to an external device, which is extremely slow when compared to the simple internal data movement of a sort.
All 8 Replies
Bench
212
Posting Pro
ultra vires
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
ultra vires
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
ultra vires
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
bumsfeld
413
Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.