Profiling multithreaded version correctly