It also takes into account how long it takes the attack to reach the target. That's why almost every magic is D speed. For a melee unit .45 would be enough to be B speed because their attacks hit instantly, and C speed for many missile units because their missiles usually travel faster than the magic balls (??? lol)