measures frequency for each thread