Added TIME tacking for measuring performance of the counting query.