How to use stateDuration?

Also interested in using this but haven’t had time to try it yet. Looking at the PR it is named “stateCount” and from there I found the documentation.