Code:
loop:
If pot value => 3V then time
goto loop

time:
for X = 1 to 255
pauseus 10
t = t + 1
do whatever, pot
if pot value =  5V then tCalc
next x
tCalc:
display t
goto time
You may want to consider using ADCIN in place of POT.
Notice I changed the example to PAUSEUS.
And someplace around here there is a discussion about code execution time, or just test it to adjust the PAUSEUS.