Closed echawk closed 2 years ago
a hacky, but as far as I know POSIX way to get time in seconds would be
stime=$(awk 'BEGIN{ srand(); print srand() }')
(the first srand call is needed because POSIX says "Set the seed value for rand to expr or use the time of day if expr is omitted. The previous seed value shall be returned.", so impls wouldn't necessarily return time on the first srand call, as the seed value for rand hadn't been initialized yet.
Shoot, I forgot to check POSIX. I can switch to using awk.
Builds can be timed via hooks. (Grab uptime at build start and build end, calculate elapsed time). Also, one could simply
use the time
command for this purpose (though without ability to control output format). I do not think this feature
is needed in the package manager.
Thanks for the PR.
date +%s isn't POSIX