Highly accurate time measurement in C
I'm trying to figure out a way to write some code that could accurately
figure out the time required to perform a search on a BST. Currently im
using time and the total number of elements is of the order 10^5. It looks
something like the following :-
clock_t begin, end;
begin = clock();
...
...
...
end = clock();
difference = (end-begin)/CLOCKS_PER_SECOND;
However, this does not give me the precision that I'm looking for. Are
there any other libc functions that I could use?
No comments:
Post a Comment