I was messing around at the end of the second level. The additional time that I spent in the Witch's room does not affect my final time.