private static void fibgen(channel <long> ch) { for (long x = 0L; x < 10L; x++) { ch.Send(fib(x)); } close(ch); }
public ChannelTimer(long ticks, bool continuous) { m_notify = make_channel <Time>(); m_delay = (int)(ticks / TimeSpan.TicksPerMillisecond); m_pulse = () => { m_notify.Send(Now()); if (continuous) { m_pulse?.DelayAndExecute(m_delay); } }; }