Use timer instead of loop count to wait gpu to idle