sleep

sleep(sleepTime: Integer);

The sleep method of the Process class suspends the execution of the thread of the receiver process for the specified time interval.

The following example shows the use of the sleep method.

defaultInitialize();
vars
    ini  : String;
    bin  : String;
    size : Integer;
begin
    size := system.nodes.size;
    ini  := app.getIniFileName;
    bin  := app.getJadeInstallDir;
    app.createExternalProcess(bin & '\jade.exe path = ' & app.dbPath &
                              ' app = PrintTest schema = PrintTest', false);
    while size = system.nodes.size do
        process.sleep(2000);
    endwhile;
end;

Use the sleepTime parameter to specify the time (in milliseconds) that the thread is to be suspended. A value of zero (0) causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run in the system. If there are no other threads that are ready to run, the receiver process continues execution immediately.

Unlike the Application class doWindowEvents method, the sleep method does not allow Window events to be processed while the thread is suspended.