A good rule of thumb is to allow 3-5 seconds for the substitute to alert the replaced player. The book states "immediately" as the time frame but most interpret that as within 3-5 seconds.
Now, I would give B a little more leeway than A because B really doesn't gain a huge advantage by having 12 on the field. A already has chosen its play and are in the huddle while B is getting it sorted out. I wouldn't give B too much more time than 5 seconds, but I think A certain has he bigger advantage when it comes to having too many men on the field. Plus, if it doesn’t get called before the snap they get nailed with a 15 yard penalty.