added timing functions.