Compiled a template based wrapper around using a hardware timer. All functions are inlined away.