Time pause during loop

Is it possible to put a time pause in a loop, e.g. wait 10 seconds between each iteration of the loop.
new user here, but i'd hazzard a guess that ticks, startMSTimer and stopMSTimer are the functions you would want to look at. tossing zeros into a loop would have variable results on different systems, after all.. ;)
daggaz wrote: new user here, but i'd hazzard a guess that ticks, startMSTimer and stopMSTimer are the functions you would want to look at. tossing zeros into a loop would have variable results on different systems, after all.. ;)


Sleep is the operation you want. I was making a joke about tossing extra loop iterations in somewhere :-).
daggaz wrote: new user here, but i'd hazzard a guess that ticks, startMSTimer and stopMSTimer are the functions you would want to look at. tossing zeros into a loop would have variable results on different systems, after all.. ;)

Andy's right- use Sleep. These functions are more for measuring elapsed time, not for pausing execution.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
andyfaff wrote: Excellent, reminds me of this article:
http://thedailywtf.com/Articles/The-Speedup-Loop.aspx


sleep/s 10


Hi,
May this be used to update a graph if put in a loop?
Here is my code:

function PlotProfiles(NameRun)
	wave NameRun
	wave svx,sy
	variable numrun
	string strsvx,strsy,strfit
	for (numrun=0;numrun<numpnts(NameRun);numrun+=1)
		strsvx="cnvx"+num2str(NameRun[numrun])
 		strsy  ="cnsy"+num2str(NameRun[numrun])
 		strfit ="fit_cnvx"+num2str(NameRun[numrun])
 		duplicate/O $strsvx svx
 		duplicate/O $strsy sy
 		duplicate/O $strfit fit_cnvx
		print strsvx
		sleep/s 1//PauseUpdate; Silent 10
	endfor
	
End

I already have my graph window opened (
Display svx vs sy;append fit_cnvx
).

Thank you
For updating a graph in a running loop I would use
DoUpdate
,e.g., for visualizing the progress of a calculation.
Or do you want to do some animation using a time base?
HJ
HJDrescher wrote: For updating a graph in a running loop I would use
DoUpdate
,e.g., for visualizing the progress of a calculation.
Or do you want to do some animation using a time base?
HJ


That is exactly what I wanted to do. Thank you so much!

BTW, if you know how to create some animation, I would be glad to have some basic hints. I'm always willing to learn, specially when I know I'll be using this soon.
Thanks a lot!
I haven't done so much in this field yet, but start reading the help chapter about "movies"

displayhelptopic "movies"

(Or in the manual Volume IV -> Advanced {Programming IP6 /Topics IP7} -> Movies

HJ
HJDrescher wrote: BTW, if you know how to create some animation, I would be glad to have some basic hints. I'm always willing to learn, specially when I know I'll be using this soon.


When your goal is to scroll through a set of traces to make a movie, you might consider the Scroll Traces package as a start.

http://www.igorexchange.com/project/ScrollTracesPanel

You can add a plug-in to the package to generate movies from the traces.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH