An exercise 2.14 from Bernt Øksendal's "Stochastic Differential Equations":
Let $B_t$ be $n$-dimensional Brownian motion and let $K\subset \mathbb R^n$ have zero $n$-dimensional Lebesgue measure. Prove that the expected total length of time that $B_t$ spends in $K$ is zero.
My confusion comes from the fact that the I don't know how to define "total length of time" which the process $B_t$ spends in $K$ in a formal way. I was thinking to use $ T(\omega) = \int\limits_0^\infty 1\{B_t(\omega)\in K\}\;\mathrm dt \quad (1) $ so finding $\mathsf E T$ can be reduced to $ \mathsf E T = \int\limits_0^\infty\mathsf P\{B_t\in K\}\;\mathrm dt $ and checking conditions for Fubini's theorem - but I am not sure that the formula $(1)$ is correct (at least in the sense that the integral is well-defined), and I wonder how such formula should be rigorously derived to describe "total time spent in the set $K$".
Edited: A related article on wikipedia misses formality.