I don't think you're question is well formed. If Tcl is running in the foreground, well, then it is. I think what you want is for proc a to run in a separate thread. I've never used threads, myself, but I'm told they can be terribly effective. See:
proc a {} {
global myafter msec
...
set myafter [after $msec a]
}
Proc [tt]a[/tt] need be called once (and only once) by your code where you need to start it, and [tt]$msec[/tt] should not be zero, otherwise the rest of the code won't execute. [tt]myafter[/tt] is a handle that allows you to stop the loop somewhere else in the code with [tt]after cancel $myafter[/tt] . And of course if proc [tt]a[/tt] is resource consuming, it will slow down the rest of the code performed actions...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.