There are 1000 milliseconds in a second, so do something like:
And then wait until MilliSecs() returns >= StartTime+1000 ...
StartTime = MilliSecs()
And then wait until MilliSecs() returns >= StartTime+1000 ...
StartTime = MilliSecs()