Benchmarking : get algorithm user time
An answer to this question on Stack Overflow.
Question
I'm trying to test the performance of an algorithm I wrote in C++. I use my university calculation cluster (via SGE)
The problem is that I don't know when the server is full or not with other calculations and so I can't measure the effective User time (I'm supposing it doesn't change whenever the process is so busy or not, am I wrong ?)
Isn't the usertime the time used to calculate and compare the time performance between algorithms ? Because I don't get the same result for the same execution
Answer
If you're on a time share the algorithm's run-time will vary from run to run.
Have you tried the shell time command?
time [MY PROGRAM]
or, for significantly more information, the GNU Time command?
/usr/bin/time <MY PROGRAM> [ARGS]
These commands would be an easy place to start and will provide you some of the information you need.
Also, you mention a cluster, perhaps you are using MPI or another framework? Perhaps this framework has some built-in timing commands (I'm not sure if such things exist, but it may be worth looking into).