What if system_time.sec_part == TIME_MAX_SECOND_PART here:
 
      else
      {
        start_time= t;
        start_time_sec_part= ++system_time.sec_part;
      }

?
--
All the best,

Aleksey Midenkov
@midenok