native channel TimersUpdated {
	in timers(curTimers: Map, update(curTimers, nextTimers)) = nextTimers
}

native channel TimerEvent(tid: Str) {
	out timers.{tid}.count(count: Long, tick()) = count + 1
}

channel StartTimer {
	out timers(timers: Map, startTimer(tid: Str, interval: Long)) = insert(timers, tid, {"interval": interval, "count": 0})
}

channel ClearTimer {
	out timers(timers: Map, clearTimer(tid: Str)) = delete(timers, tid)
}
