It probably depends on how frequently DG ticks. There's no way to ensure the AI is going to use a charge move. I've faced gyms where I've launched two stone edges before one hyper beam. Sometimes I can barely get my first SE in before a HB.
Lets replace Hyper beam with say, aqua tail. Theoretically AT should hit before you can even launch a SE. Sometimes it just doesn't work that way though.