Question in Scheme

Posted on 2006-04-16
Medium Priority
Last Modified: 2006-11-18
How do I set a timer to run for 10 seconds in Scheme before executing the next command.

Question by:sandya_116
1 Comment

Accepted Solution

smkern earned 2000 total points
ID: 16483969
What variant of Scheme are you using?  I do not believe that there is a standard method of creating threads/timers in scheme, and it will instead be variant-specific.

(Petite) Chez Scheme includes support for threads.  With the included SWL library, you can make a simple timer:
Here is the main website:

Here is some documentation specific to threading.
http://www.scheme.com/csug7/threads.html#./threads:h0 <-- Refer to for creating a thread
http://www.scheme.com/swlman/threads.html#g2463 <-- Refer to for sleeping a thread

Sample code:

(define (timer) (thread-sleep 10000) (display "Hello World"))

(fork-thread timer)
(display "Main Thread")

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
This article will show, step by step, how to integrate R code into a R Sweave document
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question