Timing of antimicrobial use influences the evolution of antimicrobial resistance during disease epidemics