[backport#16908] util: Add count_seconds time helper
Summary:
https://github.com/bitcoin/bitcoin/pull/16908/commits/faaa1f01daba94b021ca77515266a16d27f0364e
Depends on D6523
Partial backport of Core PR16908
Test Plan:
ninja
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D6524