How do I re-format the 'time' command's output?

How do I re-format the 'time' command's output?

Post by Eric » Sat, 31 Jul 1999 04:00:00



I've been trying to use the 'time' command built-into tcsh to time
processes.  Although it reports the time used correctly and all, I'm trying
to following the instructions in the man page to have it also display the
amount of memory used by the process.

From the tcsh man page:
  time    If set to a number, then the time builtin (q.v.) executes auto-
            matically  after  each  command which takes more than that many
            CPU seconds.  If there is a second word, it is used as a format
            string  for  the  output of the time builtin. (u) The following
            sequences may be used in the format string:
                    ...
            %X  The average amount in (shared) text space used in Kbytes.
            %D  The average amount in (unshared) data/stack space  used in
                   Kbytes.
            %K  The total space used (%X + %D) in Kbytes.
            %M  The  maximum  memory  the process had in use at any time in
                   Kbytes.
                     ...

My problem is that I have no idea how to format this time variable.  I've
tried just about everything I can think of (and then even some stuff that
others have suggested), but to no avail.  I just can't seem to get the
format string to change at all  - not in the slightest.

Has anyone else modified the output of this command before?  Do you know how
I can determine the total/max amount of memory used by a process?  In theory
the time
command does just that - I just can't get it to work.  And 'top' isn't an
option.

Thanks!

Eric


 
 
 

1. output rediection for 'time' command

I want to time a command and redirect the outputs of both commands to a file.
        time my_command > out
        0.2u 0.3s 0:00 58% 0+280k 13+0io 11pf+0w
How do I do that? Thanks in advance.

Dave
                        \\|//


University of Melbourne  \_/     |  uunet    : uunet!munnari!mullian!dtau

2. make not found

3. how to change the default output of 'time' command

4. cross-wire cable can stack switches?

5. About the 'TIME' header of the 'ps' command

6. Merging keyboard input with serial console input?

7. Odd 'w', 'who' and 'tty' output

8. Nazi kernels

9. Piping results of a 'find' command to a 'mv' command...

10. How to hide from 'who', 'finger', 'ps' commands?

11. Help with 'user', 'w', 'who' commands

12. 'last' command doesn't show complete login times

13. 'time' command doesn't display memory usage