Tick generator using interval.

Close #1166.
Specify return type in the method signature?