Thread measurement script