1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Millisecond precision for 'times' builtin (re: 65d363fd, 5c677a4c)

Now that we have an iffe feature test for getrusage(3), introduced
in 70fc1da7, the millisecond-precision 'times' command from the
last version of ksh2020 can easily be backported.

src/cmd/ksh93/bltins/misc.c:
- Incorporate ksh2020 'times' command, with a couple of tweaks:
  * Use locale's radix point instead of '.'.
  * Pad seconds with initial zero if < 10.

src/cmd/ksh93/data/builtins.c:
- Update version date for 'times --man'.

src/cmd/ksh93/tests/builtins.sh:
- Update 'times' test for 3 digits after radix point.
This commit is contained in:
Martijn Dekker 2020-07-15 04:11:33 +01:00
parent c5820aabc9
commit b1a4131123
4 changed files with 59 additions and 13 deletions

View file

@ -1906,7 +1906,7 @@ USAGE_LICENSE
;
const char sh_opttimes[] =
"[-1c?@(#)$Id: times (ksh93) 2020-06-24 $\n]"
"[-1c?@(#)$Id: times (ksh93) 2020-07-14 $\n]"
"[+NAME?times - display CPU usage by the shell and child processes]"
"[+DESCRIPTION?\btimes\b displays the accumulated user and system CPU times, "
"one line with the times used by the shell and another with those used by "