Hi,
I am working with a test harness and I need to monitor a process. If the process isn't done in a specific alloted time, I need to abort the process. The code goes something like this...
startTime = time.clock()
App.ActiveProje ct.ActiveProces sor.Run(True) # This will start the process
while(Processor State != HALT):
endTime = time.clock()
elapsedTime = endTime - startTime
if(elpsedTime > 900): # abort the process if it takes more than 15 minutes
App.Stop
break
else:
continue
The problem I am facing is that once the comand in line # 2 is executed, the process starts and the interpreter will not go to the line # 3 untill line # 2 execution is completed which makes the rest of the monitoring code useless.
Appreciate any ideas of going around this problem as I new to Py.
Thanks,
SN
I am working with a test harness and I need to monitor a process. If the process isn't done in a specific alloted time, I need to abort the process. The code goes something like this...
startTime = time.clock()
App.ActiveProje ct.ActiveProces sor.Run(True) # This will start the process
while(Processor State != HALT):
endTime = time.clock()
elapsedTime = endTime - startTime
if(elpsedTime > 900): # abort the process if it takes more than 15 minutes
App.Stop
break
else:
continue
The problem I am facing is that once the comand in line # 2 is executed, the process starts and the interpreter will not go to the line # 3 untill line # 2 execution is completed which makes the rest of the monitoring code useless.
Appreciate any ideas of going around this problem as I new to Py.
Thanks,
SN
Comment