#define SECONDS_PER_DAY (24 * 60 * 60) nStartSecs = seconds() ... nElapsed = mod(SECONDS_PER_DAY + seconds() - m.nStartSecs, SECONDS_PER_DAY)For longer time intervals one can keep the corresponding DATETIME() values in addition to the seconds to make a more universal timer that is accurate for short intervals and does not fail on longer ones:
tStartTime = datetime() nStartSecs = seconds() ... nEndSecs = seconds() nElapsed = datetime() - m.tStartTime if m.nElapsed < SECONDS_PER_DAY nElapsed = mod(SECONDS_PER_DAY + m.nEndSecs - m.nStartSecs, SECONDS_PER_DAY) endifBut this kludgery is only necessary because