Export (0) Print
Expand All

Object.setTimeOut Method

Sets up the scheduled execution of a specified method.


public int setTimeOut( 
    str Method, 
    int WaitTime, 

Called

Parameter

Description

Method

The name of the method to call.

WaitTime

The time in milliseconds before the method is called.

idle

A value that specifies when the time should start; optional.

  • If this argument is true (default), the interval is measured from when the keyboard or mouse was last used.

  • If this argument is false, the time is measured from the call of the setTimeOut method.

The timer handle to be used if you have to cancel the timeout.

The scheduled time out is automatically removed after the method has been called. If you want to cancel the execution of the method before the specified time has elapsed, you can do it by using the cancelTimeOut method.

The following example prints text to Infolog after two seconds.


static void setTimeOutJob()
{
    Object o = new Object();

    void printText()
    {
        ;
        info( "2 seconds has elapsed since the user did anything" );
    }

    // Set a Time Out with the idle flag set to false
    o.setTimeOut(identifierstr(printText), 2000, false);
}

Community Additions

ADD
Show:
© 2014 Microsoft