Add time counter
Minor optimization of fitness function