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 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.
Jump to Post>but isnt the clock is supposed to be processor clock and i think
>it doesnt take into account the interupts for other device into account :|
The processor doesn't stop ticking just because you call an interrupt for a device.
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.