Having been tortured, and sentenced to death, he swoons. When he comes to, he finds himself in a room in utter blackness, wearing some course garment. He stands and gropes along until he encounters a wall. So he'd know where he began exploring, he rips "part of the hem from the robe and place[s] the fragment at full length, and at right angles to the wall" so he'll unquestionably realize when he's made a full circuit of his dungeon.
He takes a few steps and passes out from weakness. When he awakes, he continues his measurement until he comes to the hem again. (Unfortunately, he later discovers, he miscounted in his weakness and got it wrong by double.)
After deciding he knows the circumference of his room, he decides to walk directly across it. Fortunately, he trips on the hem he left lying on the floor and fell face first on the floor, only then realizing that the top of his head had not made contact. He thus discovers a very deep pit in the middle of the room.