If you had comp markers in Comp B marking the start and end times, a text expression like this in Comp A would display the current frame (within the range – blank if not in the range). I’m not sure that’s what you’re asking, but it might get you close:
m = comp("Comp B").marker;
txt = "";
if (m.numKeys > 1){
t1 = m.key(1).time;
t2 = m.key(2).time;
if (time >= t1 && time <= t2){
txt = timeToFrames(time);
}
}
txt