--- Dodo Speaks <dodospe...@...> asked:
>
> I have seen on various coding competition sites that also take the time
> taken by the algorithm code in consideration for judging purpose. Just
> wanted to know how do we calculate this time, do we use any software for
> that. Please let me know the way. I need to compute my algos time.

  On Linux:

pe...@ubuntu:~$ time echo "Hello,"
Hello,

real    0m0.000s
user    0m0.000s
sys     0m0.000s
pe...@ubuntu:~$ perf stat echo "Hello,"
Hello,

 Performance counter stats for 'echo Hello,':

       3.092855  task-clock-msecs         #      0.789 CPUs 
              2  context-switches         #      0.001 M/sec
              0  CPU-migrations           #      0.000 M/sec
            185  page-faults              #      0.060 M/sec
        2450211  cycles                   #    792.217 M/sec
        1183325  instructions             #      0.483 IPC  
         582159  cache-references         #    188.227 M/sec
          12935  cache-misses             #      4.182 M/sec

    0.003920440  seconds time elapsed

pe...@ubuntu:~$ 


Reply via email to