Use time command.
time ./perl-timeout-example 100.100.100
We could not ping the desired address!
real 0m5.0013s
user 0m0.004s
sys 0m0.008s
Normally, user + sys is the total CPU time spent on such process. It is smaller than real. But in multicore CPU, user + sys is the total CPU time spent on this process. It could be large than real.