FWIW that is supported by many zsh themes like pure, p9k, p10k, ... (and often enabled by default).
Also:
REPORTTIME
If nonnegative, commands whose combined user and system execution times (measured in seconds) are greater than this value have timing statistics printed for them.
which is slightly different but generally useful, and built-in.
I didn't know about `$SECONDS` so I'm going to change it to use that.