ScheduleConfig: compute delay without using loops

Also make the computation of the delay for the case "start < now"
consistent with the case "now < start" i.e. make sure that the
computed delay is never zero.

Change-Id: I807637fdaf209f8a3b7e7a04d3504809ee591a07
2 files changed