Add unit tests for periodic and delay. Make periodic emit current tick value