You could use the TTimer component, however Windows gives that a very low priority when sending messages to applications and vice versa.
Simba Code:
program new;
var
Timer: TTimer;
Params: TVariantArray; // Useless, but required...
procedure OnTimer(Sender: TObject);
begin
// Procedure to repeat every ten seconds here...
end;
procedure InitialiseTimer;
begin
Timer := TTimer.Create(nil);
Timer.Interval := 10000; // Every ten seconds.
Timer.OnTimer := @OnTimer;
Timer.Enabled := True;
end;
begin
ThreadSafeCall('InitialiseTimer', Params);
repeat
Sleep(1000);
Until(False);
Timer.Free;
end.
However, it runs on the main-thread, and Simba for some silly reason unbinds the Writeln called from within PascalScript to the native one which prints text to the console, and not the debug box. Apart from that, it should be okay.