Measuring time using benchmark