TimeOverIt function.
This is supposed to be a failsafe that will exit if it finds the script is taking longer than expected, it will exit. I know it is basic but I made it as my first function anyways.
Edit: Updated!!! Again!!!
SCAR Code:
program TimeOver;
{.include SRL/SRL.scar}
function TimeOverIt(ms: integer): boolean; //By cut em2 it
begin
if (TimeFromMark(Time) > ms) then
begin
Result := True;
Writeln('The program will now terminate because it is taking too long.');
Exit;
end;
end;
procedure UseTimeOverIt;
var Time: integer;
begin
MarkTime(Time);
Wait(4000);
TimeOverIt(3000);
end;
begin
UseTimeOverIt;
end.
Thanks,
Cut em2 it
Formerly known as Cut em2 it