Waiting for ticks in thread instead of sleeping
ref
ref
Preparing to implement statistics collection