Measure using ThreadMXBean.