Timer

+timer class
+minor refactor (see main.cpp)