Makes a pause for a given number of seconds during execution of a program.
Is the number of seconds that the application will be waiting. It can be a numeric variable or a constant. .
Objects: Procedure, Transaction, Web Panel, Data Provider
Generators: .NET, .NET Framework, Java
This function is useful, for instance, to implement a "daemon" to be executed with specific timeouts. The idea is to have an infinite loop and to have a waiting time of a specific number of seconds between each iteration. Thus, its use is recommended in 'batch' processes rather than in interactive applications, where the application 'dies' before the timeout specified is over.
Sleep function is better than a loop because it does not consume CPU resources. It is implemented using the Thread.Sleep method of the .Net Framework / Java Virtual Machine.
&var = sleep(15) // It waits 15 seconds and in &var it returns 0
&var = sleep(0) // It waits 0 seconds and in &var it returns 0
&var = sleep(-10) // It waits 0 seconds and in &var it returns 0