Detecting an Epidemic in Real Time