Added a measure function.