there is a much easier way of doing this:
Turing Reference Manual wrote:
Time.DelaySinceLast Part of Time module
Syntax Time.DelaySinceLast ( duration : int )
Description The Time.DelaySinceLast procedure is used to cause the program to pause for a given time since the last call to Time.DelaySinceLast. The time duration is in milliseconds.