Fixed elapsed time in API level 17 and above