What I do is to use a relative game timer that's updated by the amount of time taken by the previous loop at the start of each new loop.
eg.
; Untested code.
; 'game_time' holds the time value which should be used with all pausable time_out routines.
Global game_time
Global old_time
Global millisecs_time
Global time_out
old_time = MilliSecs()
Repeat
millisecs_time = MilliSecs()
the_time_taken = millisecs_time - old_time
game_time = game_time + the_time_taken
old_time = millisecs_time
If game_time > time_out
time_out = time_out + 1000
EndIf
If KeyHit( pause_key )
; -- Process pause event --
old_time = MilliSecs() ; Re-initialize 'old_time' after the pause.
EndIf
Until KeyHit( 1 )
eg.
; Untested code.
; 'game_time' holds the time value which should be used with all pausable time_out routines.
Global game_time
Global old_time
Global millisecs_time
Global time_out
old_time = MilliSecs()
Repeat
millisecs_time = MilliSecs()
the_time_taken = millisecs_time - old_time
game_time = game_time + the_time_taken
old_time = millisecs_time
If game_time > time_out
time_out = time_out + 1000
EndIf
If KeyHit( pause_key )
; -- Process pause event --
old_time = MilliSecs() ; Re-initialize 'old_time' after the pause.
EndIf
Until KeyHit( 1 )