Fix time.perf_counter() compatibility bug

Python3.2/PyPy3 do not support time.perf_counter(), so it is monkey-patched in
the `compat` module.