Optimum Sensing of a Time-Varying Random Event with Energy