A timer class in C++