measure program performance
hello,
If i wrote a C function then how to know that its costlier in terms of processing time,execution,compilation. I have written 2 functions for one problem but dont understand which one is best from Opereating System's overhead point of view. so i want tool that measure it. If this is not right place to ask then tell me where to ask in any other forum. |
Well if you want precise measurements use a profiler like gprof
or oprofile. Otherwise you can get a good idea of the by writing a simple wrapper program that calls your functions a lot. Code:
/* Anything your functions need */ time ./test_func Warning depending on your function 2^32 or 2^64 (which depends on your platforms architechture) may take a long time to complete. |
All times are GMT -5. The time now is 07:29 PM. |