Update timer.cpp

Minor exception handles