What's wrong with your debugger? You seem to not be using it.
Try checking the return values of functions that could fail.
If al_wait_for_event_until times out, then the value of ev is most likely unchanged since the last time that it was altered. Check the return value of al_wait_for_event_until and if it timed out, don't check the event value.
You never initialized timesrc to a value other than NULL, I don't know if that would crash or not.
You also never created an ALLEGRO_TIMER, nor did you register it with
so you'll never get any ALLEGRO_EVENT_TIMER events either.