timer

class FormRun extends ObjectRun

{

// set the wait time interval to 1 second

#define.waitTime(1000)

}
void run()

{

super();

this.updateRealTime();

this.updateIdleTime();

}
void updateRealTime()

{

// Set the time on the Real Time control on the form

realTime.value(timenow());

// Set a Time Out with the idle flag set to false

this.setTimeOut(identifierstr(updateRealTime), #waitTime, false);

}
void updateIdleTime()

{

// Set the time on the Idle Time control on the form

idleTime.value(timenow());

// Set a Time Out with the idle flag set to True

this.setTimeOut(identifierstr(updateIdleTime), #waitTime, true);

}
Anuncios