How do you tell if your code is running in a Routine?

I have code and I sometimes run it in a Routine, sometimes not. It has waits in it, which only make sense in a Routine. I’ve looked for isRoutine, but there doesn’t seem to be any. How can I determine this so as to make the appropriate control structures?

                   Thanks For Your Attention

There is a method forkIfNeeded that wraps a function in a routine only if necessary. You can also explicitly check by thisThread.isKindOf(Routine).