Using Timer class for timing