
Executing Instruction once every second
Quote:
> I tried this. I get an error when I use the after command (tcl 7.4). Looking
> at the tcl man pages, it looks like you need to have events enabled to use
> after. So I tried using update and vwait (per the main page) to enable
> events, but that didn't work either.
> Using the method you described below I can determine how many microseconds
> the loop body takes to execute. Now, I can't get it to sleep for the
> remainder of the second.
Your original post claimed version 7.5 and those man pages say that after/vwait exist
I don't have access to 7.4 pages but it appears they don't have them
You mention that you are using expect ? if so, it has a sleep command
that takes decimal seconds so
use the time method, followed by
sleep [expr (1000.0 - [lindex $res 0]) / 1000.0]
instead of the "after" command
Bruce