Time based counter