Yesterday I discovered coroutines. A very handy tool.
I have the following code:
proc startVmstatLogging {} {
coroutine vmstatLogging apply {{} {
set command "|env TZ=UTC vmstat -n -S M -t 60 5"
after [getWaitMinutesTicks 1] [info coroutine]
yield
set vmstat [open ${command} RDONLY]
I want the vmstat command to be opened as close at possible. With
[getWaitMinutesTicks 1]
I get the number of ticks until the start of the next minute.
Is this the correct way to wait until the next minute without
blocking, or is there a better way?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn:
http://www.linkedin.com/in/cecilwesterhof
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)