cpu and time measurement for multithreading