Added test cases.
Fixed a bug with the wall clock and periodic window with the elapsed variable in tock().