Fixed timing stuff on master. Added thread-safe option to perf.