improve getTimes performance