Timer class for offline analysis of runtimes

Small timer class to measure runtime of functions nicer. Timings are
pickled as ms/frame and saved into file at exit. Not saved when
crashing.