Retrieving the execution time of a completed command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Retrieving the execution time of a completed command
# 1  
Old 09-06-2005
Question Retrieving the execution time of a completed command

Hello,

I am new to this forum and relatively new to unix, but hope to become an expert soon!

My question is: How can I find out the execution time of a command that has already completed execution? More specifically, I launched a Python script to populate a PostgreSQL database on Suse Linux, using "python myscript.py" (without saying "time" before launching the command). Now the script finished execution, and I want to find out how long it took. Is there a way to do that?

Thanks in advance,
Marina.

Last edited by marina; 09-06-2005 at 11:52 AM..
# 2  
Old 09-06-2005
Generally, you need to know that you want this BEFORE you run the script:

Code:
time myscript.py

is how to do it.
# 3  
Old 09-06-2005
As a second much more complex thought - if you have accounting turned on and the script ran as a special user you can use the last command to get how long that user was logged in to run the job. Not just the script, however.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Retrieving previous command in a script

i know from the command line, the symbol $_ is used to get the last command that was run. however, id like to replicate this within a script. meaning, how do i do something like this: #!/bin/sh ps -ef | egrep talling StoreThisLastCommandA=$_ awk '/error/ {print $3}' /tmp/test... (5 Replies)
Discussion started by: SkySmart
5 Replies

2. UNIX for Dummies Questions & Answers

time taken for execution

how much time a particular command or shell script executed there is any command to know this thanks (5 Replies)
Discussion started by: tsurendra
5 Replies

3. Shell Programming and Scripting

System terminating diff command before job completed

I'm running diff at the command prompt against two very large text files (>1GB) and system kills the process and replys back "Terminated" after 15 seconds. I believe a system parameter needs to be adjusted but can't figure it out. I'm running Red Hat 4.1.2-46, 2.6.18-028stab089.1 Thanks... (4 Replies)
Discussion started by: azpetef
4 Replies

4. Shell Programming and Scripting

Java hangs even though shell script’s execution is completed

I'm trying to execute a script from within my java code. The execution of the script is over(it's pid is no more), but java is stuck on waitFor() method of the shell script process!. And yes, I'm reading output and error streams in 2 separate threads. Yes, they are being joined at the end(after... (0 Replies)
Discussion started by: pavanlimo
0 Replies

5. UNIX for Advanced & Expert Users

Retrieving command line arguments of a particular PID

hi The "ps" command shows the command line arguments of running processes: $ /bin/ps -o pid,args -e .... 26031 pico /tmp/crontab2KaG1Y 596 /usr/lib/sendmail -bd -q15m 9955 xterm -n 1 -sb -sl 800 -g 80+70+70 2627 /usr/sbin/snmpd -Lsd -Lf /dev/null -p /var/run/snmpd -a 1691 .... I... (2 Replies)
Discussion started by: Andrewkl
2 Replies

6. Shell Programming and Scripting

command execution time

Hi all, I want to display a progressbar depending upon the completion status of a command. I am coding from scratch as I dont want to use in place code. so Is there anyway of getting the progress of a command in percentage or in any other units while its running , is it possible using the top... (5 Replies)
Discussion started by: hashin_p
5 Replies

7. UNIX for Advanced & Expert Users

specifying an execution time

Hi all, do ny o u'll know how to set a particular execution time for a program??? for eg.: --> during the execution of a file, i call a certain other function. --> while calling this function, my comp hangs. now is there ny way in which i can go to the nxt line of code by aborting the call... (7 Replies)
Discussion started by: VGR
7 Replies

8. HP-UX

Retrieving the full command

Hi All, I would like to retrieve the whole command that got executed for a running process rather than a truncated string, as a result of running ps -ef on HP-UX. Please help. TIA (1 Reply)
Discussion started by: trocadero
1 Replies

9. UNIX for Dummies Questions & Answers

last execution time

is there a command in Solaris 8 that will show a particular scripts last execution time? (1 Reply)
Discussion started by: cubs0729
1 Replies

10. Programming

execution time

hi , i ve coded a C program in that im using malloc dynamically , it is being called many times in the program The program is to simulate jobs in manufacturing system. the execution time is increasing drastically as the number of jobs are increased. could any body tel what may be the problem... (2 Replies)
Discussion started by: ramki_rk
2 Replies
Login or Register to Ask a Question