Tick generator using interval.

Close #1166.
This logic seems pretty complex.  I'll need to study into this to see if it can be simpler