Real-Time Delays

version 1/100607 by Erik Temple

  • Home page
  • Beginning
  • Next



  • Documentation


    Real-Time Delays allows an author to request a delay of a given number of seconds. This delay occurs immediately, and no input or output can occur until the specified time has elapsed. It requires both Glulx Entry Points (built in) and Michael Callaghan's Fixed Point Maths extension.

    The use of the extension is quite simple. The length of the delay is specified in milliseconds, e.g. 1000 represents one second. We may write a phrase such as

        wait 1450 milliseconds before continuing
        wait 14500 ms before continuing

    at virtually any point in our source code. The delay is triggered immediately, and the action will not advance until the specified period has passed. However, we may tap the Return/Enter, Space, or ESC key at any time to immediately end the delay. To disable this for the Enter and Space keys, add "strictly" to the instruction:

        wait 1450 milliseconds before continuing, strictly

    The Escape key will always allow the action to continue, no matter which version of the phrase is used.

    The extension will ignore calls to the real-time functions on interpreters that don't support them. If you'd like to subsititute an alternate effect on those interpreters, you can use this phrasing to fork between the two treatments:

        if glulx timekeeping is supported

    See the documentation for Glulx Entry Points for more information.