Function to stop scheme for a certain time
delay, scheme, time
Solution
This depends on the interpreter being used (it's implementation-dependent). For instance, in Racket you can call the `sleep` procedure:
(display "Hello ") (sleep 2) (display "World!")
From the documentation:
`(sleep [secs]) → void?` Causes the current thread to sleep until at least secs seconds have passed after it starts sleeping. A zero value for secs simply acts as a hint to allow other threads to execute. The value of secs can be a non-integer to request a sleep duration to any precision; the precision of the actual sleep time is unspecified.
Problem
does anyone know a Scheme function that delays yours program for a certain time? I know the most languages have a function where you say for how many time you want that the program must wait, but I can't find it in Scheme. I know the "delay" function in Scheme but that's not what I want, it only gives you a promise but don't stop running you program for a few seconds. Thanks for your help! :)