refactor timer

Hopefully MSVC has support.