Tips for new TMS Web Core developers and in particular for seasoned Delphi developers

Here is a Sleep function that you can call like this: await(UInt32, Sleep(100))

function Sleep(milliseconds: UInt32): TJSPromise;
begin
  Result := TJSPromise.New(
    procedure(success, _: TJSPromiseResolver)
    begin
      window.setTimeout(
        procedure
        begin
          success(milliseconds);
        end,
        milliseconds
      );
    end);
end;
1 Like