It occurs in Durrett's proof of Skorokhod embedding that he needs the following.
Suppose that we have a Brownian motion $B_t$ in $1$-d that starts at $0$. (To be clear, it is not necessarily constructed on the Wiener space, but I do require it to be everywhere continuous. With that assumption, then we have that $T_{b, a}=\inf\{t\geq 0 : B_t \notin (a, b)\}$ is a stopping time wrt the standard right continuous (RC) filtration.) If $U, V$ are RVs with $U\geq0$ and $V\leq0$ then supposedly the function $T_{U, V}$ is measurable. (with respect to the original sigma algebra for which $U, V$ are RVs.) Notice that this does not make it a stopping time.
I need help with that.
He also then uses the optional stopping theorem for continuous RC martingales with RC filtrations. This theorem implies that if $T$ is the stopping time and $X_t$ is the martingale, then $X_T$ is measurable wrt the sigma algebra of the stopping time $T$ and also for all $t\geq0$ we have $X_T=E(X_t\mid \mathfrak{F}_T)$ on $\{T<t\}$ a.s.
Durrett only says that by conditioning on the values of $(U, V)$, we can apply this to our situation above to conclude that (By now he has already started assuming the measurability of $T_{U, V}$.)
$$E(T_{U, V})=E\lbrace E(T_{U, V}\mid (U, V))\rbrace=E(-UV).$$
He has already shown that $E(T_{b,a})=-ab$. Where I object is it seems like his manipulation is "treating $U, V$ as constant" just because they are the subject of being "conditioned upon." I don't understand this, especially since $U, V$ are allowed to take values in continua.
(For those with the book, see p. 384 and the surrounding.)