added functions for timing