Extract function, add timeout

If I don’t have my environment set up correctly, I’d like fast feedback
on that.