setTimeOut&cancleTimeOut
Object.setTimeOut Run on: Called
Description
Use the SetTimeOut method to setup timed execution of a specified method. You only need to specify the name of the method to call, and the time in milliseconds before the function should be called.
The interval can be measured i two ways:If the last argument (idle) is TRUE (default), the interval is measured from when the keyboard or mouse was last used.If the idle-argument is FALSE, the time is measured from the call of SetTimeOut, without regard to keyboard use. The latter form should be used with care since time-intensive tasks activated while the user is using the machine can slow things down.
Syntax
public final int setTimeOut(str _Method, int _WaitTime [, boolean _idle] )
Arguments
public final int setTimeOut(str _Method, int _WaitTime [, boolean _idle] )
Returns
Int - Timer Handle to be used if you need to Cancel the Timeout.Remarks
The scheduled timeout is automatically removed after the method has been called. If you would like to cancel execution of the method before the specified time has elapsed, this can be done using the CancelTimeOut method.
See the sample form tutorial_timer that demonstrates both idle and non-idle timers. Try using the keyboard in the two edit-fields, and watch one of the clocks stop. This is the one controlled by an idle timer.
Example
int th;
th = this.SetTimeOut("TimedEvent",2000);
....
int TimedEvent()
{
print "2 seconds has elapsed since the user did anything";
}
Object.setTimeOut Run on: Called
Description
Use the SetTimeOut method to setup timed execution of a specified method. You only need to specify the name of the method to call, and the time in milliseconds before the function should be called.
The interval can be measured i two ways:If the last argument (idle) is TRUE (default), the interval is measured from when the keyboard or mouse was last used.If the idle-argument is FALSE, the time is measured from the call of SetTimeOut, without regard to keyboard use. The latter form should be used with care since time-intensive tasks activated while the user is using the machine can slow things down.
Syntax
public final int setTimeOut(str _Method, int _WaitTime [, boolean _idle] )
Arguments
public final int setTimeOut(str _Method, int _WaitTime [, boolean _idle] )
Returns
Int - Timer Handle to be used if you need to Cancel the Timeout.Remarks
The scheduled timeout is automatically removed after the method has been called. If you would like to cancel execution of the method before the specified time has elapsed, this can be done using the CancelTimeOut method.
See the sample form tutorial_timer that demonstrates both idle and non-idle timers. Try using the keyboard in the two edit-fields, and watch one of the clocks stop. This is the one controlled by an idle timer.
Example
int th;
th = this.SetTimeOut("TimedEvent",2000);
....
int TimedEvent()
{
print "2 seconds has elapsed since the user did anything";
}
See Also
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
자바스크립트로 타이머 만들기JavaScript와 HTML만 사용하여 간단한 타이머를 만들어 보겠습니다. 먼저 인터페이스를 만들고 HTML만 사용하여 간단한 작업을 수행합니다. HTML 구조에서 시간 정보를 표시하기 위해 일부span가 생성되었...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.