Question in Scheme

Posted on 2006-04-16
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
    LVL 1

    Accepted Solution

    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. <-- Refer to for creating a thread <-- Refer to for sleeping a thread

    Sample code:

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

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

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable 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…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now