How to go around measuring text synchronously?

For computing the text width, there is this package from @folkertdev:

2 Likes