Tick generator using interval.

Close #1166.
Another PR needs to go before that, but I will add it.