N
Nishu
Hi All,
I wanted to profile my function.
I've two choices.
1. using time.h and clock() function.
2. using sys/time.h and gettimeofday() function.
Could you help me to know which one is better in precision (advantages/
disadvantages) and under what circumstances one should use which
function?
My observation :
I've used both functions for profiling. clock() doesnt look very
precise so I took median of 7 readings and for gettimeofday() I took
mean of 5 readings. Both comes almost same. But my knowledge is half
and I dont know the answer of my query.
Thanks,
Nishu
I wanted to profile my function.
I've two choices.
1. using time.h and clock() function.
2. using sys/time.h and gettimeofday() function.
Could you help me to know which one is better in precision (advantages/
disadvantages) and under what circumstances one should use which
function?
My observation :
I've used both functions for profiling. clock() doesnt look very
precise so I took median of 7 readings and for gettimeofday() I took
mean of 5 readings. Both comes almost same. But my knowledge is half
and I dont know the answer of my query.
Thanks,
Nishu