profiling

Measuring execution time and memory used


Most online judges have some sort of system to measure execution time and memory consumption. An example is shown here. How is it done? Is there a simple UNIX utility I can use to run similar tests on my own programs?


Solution

  • Valgrind with all it's tools will give you some info:

    In addition you can use more sophisticated software, like Intel VTune.

    If you are interested in low level details and the real hardware counters yourself then have a look at the perfmon2 which has some chances of getting into mainstream kernel some time in the future.

    And search old questions - there are many posts on this subject.