find out the length of the path traveled by mouse