I'd like to use bash's builtin time
command to measure the remaining cpu/user time used up by a program that is already executing.
More precisely, I would like to write a bash script that, given a process id, will print the cpu time used by that process between the time when the script was started and the time when the process exits. The output should be produced right after the process exits.