last changes to counter class
change to support lambdas on timing type