Realistically, the user function could print to stdout as soon as it elapses, which would interfere with cleanup. The tests already incorporate stdout redirection, so it should be possible to redirect function output to a buffer, displaying it only after the spinner has been cleared.
Realistically, the user function could print to stdout as soon as it elapses, which would interfere with cleanup. The tests already incorporate stdout redirection, so it should be possible to redirect function output to a buffer, displaying it only after the spinner has been cleared.