Handle if 1000 milliseconds is set as timeout

I think this was the intended behavior … so that 1 second goes through
the first if condition and sets the ts_sec to 1.