changed timing functions

timing functions simplified