« Back to TCL-API

"after" command not supported? I need a sleep-like function

Combination View Flat View Tree View
Threads [ Previous | Next ]
Within a function, I need to delay the execution of an httpios::geturl call by a couple of seconds.
 
I read that there is no sleep function in TCL and that I should use after instead.
 
Using the after command I get the following error:
 

   Mar 21 18:04:52.198: TCL script failure 
Result:
   invalid command name "after"

 
Is after not available somehow?
 
I would believe, according to[1] that the function is available.
 
I'm calling the function like so:
 
  # wait 10 seconds
  after 10000
 
thanks for any help!
 
[1] http://www.cisco.com/en/US/docs/ios/12_3t/12_3t2/feature/guide/gt_tcl.html

Hi Adolfo,

try to use named timer command, When the timer expires, the script receives an ev_named_timer event then you can call httpios::geturl.

timer start type time

Thanks,
Raghavendra