* Michael Kerrisk <mtk.manpages@xxxxxxxxx>, 2020-09-13, 07:58:
Casting to long is the historical practive here, and should be sufficient, don't you think?
It general, the practice of casting time_t to long is wrong. There are existing systems that have 64-bit time_t but 32-bit long.
In this particular case, we're measuring CPU time, so there's practically no danger of overflow.
I'd either cast it to int (to make the code shortest and simplest) or to intmax_t (to be pedantically correct).
-- Jakub Wilk