Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tcl timer command

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am looking for a tcl timer command that would wake up after a pre determined time ( seconds etc ) and run another tcl command.
 
The answer is "after".
syntax: after ms cmd
example:
Try this:
set x 12
after 15000 [incr x]
while {$x < 13} {
puts $x
}
 
Well, I know about the &quot;after&quot; command. What I want is an automatic timer. For example, the timer is set to wake up every second to do something. I only need to set the timer once. After I set the timer, I should be able to do something else.
 
Well, I know about the &quot;after&quot; command. What I want is an automatic timer. For example, the timer is set to wake up every second to do something. I only need to set the timer once. After I set the timer, I should be able to do something else.
 
Something like this:
Code:
proc imhere {} { puts &quot;I'm here!&quot;; after 1000 imhere }
imhere
puts &quot;but can do other things&quot;
?

Indeed to need an event loop (implicit with wish, explicit with tclsh)

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top