Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Process CPU processing
As long as I use the program, it needs CPU-time every so many seconds. So I think I can kill the process if it does not use CPU-time for 5 seconds or so...
Is there any way to check about a process is using CPU-time?
This behavior is a design feature of Windows NT. The Ntvdm.exe and Wowexec.exe processes remain in memory in case you start another 16-bit program. Leaving the Windows-On-Windows (WOW) environment (which consists of the Ntvdm.exe and Wowexec.exe processes) in memory improves performance.
The WOW environment is not loaded when you start Windows NT. It is loaded when you first start a 16-bit program.
However if you are refering to a 32 bit application, Maybe if the following code fits your needs. It basically monitors a process every second or so, and checks the '% processing time'. It will wait up to the value specified by the timeout variable.
;Addextender("wproc34i.dll") Addextender("wwprc44i.dll") timeout = 5 appname = "PopMenu" counterstring=StrCat("\Process(", appname,")\%% Processor Time") BoxOpen( counterstring ,"") IntControl(54,counterstring,1,0,0) if WinVersion(4)==4; NT timer = 0 intdat = 0 While timer<=timeout && intdat==0 intdat=tGetData(counterstring,0) if intdat!=0 timer = 0 intdat = 0 continue endif BoxText(strcat("Timer ",timer,@CRLF,"Int Value: ",intdat)) TimeDelay(0.5) timer=timer+1 EndWhile else Message("tGetData", "Is designed to run on NT") endif BoxShut() Message("Done","No real processing occured in the last 5 seconds" ) exitIf this doesn't fit your needs, you might want to look into some of the other 'counters' that are available that you can monitor. For a list of available counters you can launch perfmon.exe on our system.....
Article ID: W15075
File Created: 2017:07:28:13:58:38
Last Updated: 2013:04:01:09:08:08