The timer interface

The timer interface: (it is not the setTimeout(...) function from scrobj.dll).

// The timer interface (window message WM_TIMER)
// File: timer.w_js (JScript)

var cnt = 1; // 
//  Window.SetTimer(id, ms)
    Window.SetTimer(8000, 100); // 100 ms

   function WM_TIMER(id){
   var text = "Timer " + id + " Ticks " + cnt;
   cnt++;
   Window.Delete(0);
   Window.TextOut(0,50,50,text);
   Window.UpdateWindow(); 
   };
'The timer interface (window message WM_TIMER)
'File: timer.w_vbs (VBScript)

cnt = 1 
  ' Window.SetTimer(id, ms)
    Window.SetTimer 8000, 100 '100 ms

Function WM_TIMER(id)
 text = "Timer " & id & " Ticks " & cnt
 cnt = cnt + 1
 Window.Delete(0)
 Window.TextOut 0,50,50,text
 Window.UpdateWindow
End Function
Note:
You may disconnect messages of the timer, having caused method: Window.KillTimer(id)
content
The new script host. It is not wscript.exe!
JScript and VBScript are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.