comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Stop a hanging execution
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Stop a hanging execution [message #93098 is a reply to message #93093] Wed, 27 April 2016 06:24 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Tuesday, April 26, 2016 at 12:39:26 PM UTC-4, joe....@lowell.edu wrote:
...
> My question is, is there a way that if the code takes too long on one line of code to just return and stop executing? I've been investigating tic, and toc but I can't figure out how to say if toc is much longer than tic then stop.

At the level of detail you gave, the short answer is no, there is no way to do this. You have a couple of choices.

One is to delve into the code and find a natural interruption point. There you can use GET_KBRD() to find out if a key has been pressed. Or even better, to quit if execution time exceeds some maximum.

Another choice is to use operating system functions. Mac and Linux OS's have a concept of process limits, which can include CPU execution time. The process will quit after the maximum is exceeded. Under bash, this would be achieved with "ulimit -t 600" for 600 seconds; the same thing under csh/tcsh is "limit cputime 600". You type this command at the console or in a script before running IDL, then run your IDL session.

Best wishes,
Craig Markwardt
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Farewell to Paul van Delst
Next Topic: Logical links cause EXPAND_PATH() to hang

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:47:42 PDT 2025

Total time taken to generate the page: 0.00344 seconds