checking times for optimization