Sometime we face different application with same functionality, the we ask which is better, benchmark it to find it better. In linux environment we can use time apllication to find which is better.
From stackoverflow i found this trick.
$ time (for i in $(seq 10000); do ./mycode; done)
In my opinion, Evan Teran approach is more reasonable.