delay() in Pascal

In Pascal, the delay() function is used to pause the execution of a program for a specified amount of time. It is commonly used to introduce a delay or pause in the program's execution. The delay() function takes a single parameter, which specifies the number of milliseconds to pause the program.

Here is an example of how to use the delay() function in Pascal:

program DelayExample;

uses
  crt;

begin
  writeln('Before delay');
  delay(2000); // Pause the program for 2000 milliseconds (2 seconds)
  writeln('After delay');
end.

In the above example, the program will pause for 2 seconds after the "Before delay" message is displayed, and then the "After delay" message will be displayed.

Please note that the delay() function is not available in all Pascal compilers. It is commonly found in Turbo Pascal and Free Pascal. If you are using a different Pascal compiler, you may need to use a different method to introduce a delay in your program.

[1]