fix time measuring calculation