TRQ-2845: Fixed tmp_time math in mom_main main loop

Fixed tmp_time math
Moved the logic to a function
Wrote a unit test
Merge pull request #251 from DSRCompany/TRQ-2845_wrong_time_now_math

TRQ-2845: Fixed tmp_time math in mom_main main loop