Ah, OK. I thought you wanted to control the duration with the duration of a sjingle, split marker. If you’re using two markers, try this instead:
if (marker.numKeys > 1){
t1 = marker.key(1).time;
t2 = marker.key(2).time
linear(time,t1,t2,t1,0).toFixed(1);
}else
0
Dan