To take script execution time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To take script execution time
# 8  
Old 05-03-2017
man time:
Quote:
FORMATTING THE OUTPUT
... The format string can be set using the `-f' ...
.
.
.
The resource specifiers, which are a superset of those recognized by the tcsh(1) builtin `time' command, are:
.
.
.
E Elapsed real (wall clock) time used by the process, in [hours:]minutes:seconds...
Code:
/usr/bin/time -f%E  sleep 400
6:40.00

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Optimizing script to reduce execution time

AFILENAME=glow.sh FILENAME="/${AFILENAME}" WIDTHA=$(echo ${FILENAME} | wc -c) NTIME=0 RESULTS=$(for eachletter in $(echo ${FILENAME} | fold -w 1) do WIDTHTIMES=$(awk "BEGIN{printf... (5 Replies)
Discussion started by: SkySmart
5 Replies

2. Shell Programming and Scripting

Find execution time of script

i am using bash START=$(date +%s) END=$(date +%s) DIFF=$(echo "$END - $START" ) this code is not working (14 Replies)
Discussion started by: rafa_fed2
14 Replies

3. 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

4. Shell Programming and Scripting

execution time / runtime -- bash script please help!

Hello, I'm running a bash script and I'd like to get more accurate a runtime information then now. So far I've been using this method: STARTM=`date -u "+%s"` ......... *script function.... ......... STOPM=`date -u "+%s"` RUNTIMEM=`expr $STOPM - $STARTM` if (($RUNTIMEM>59)); then... (6 Replies)
Discussion started by: TehOne
6 Replies

5. UNIX for Dummies Questions & Answers

script start and end of execution of time

Hi All, Can we get to know the start time and end time of execution of a script? (This script doesn't write any logs.) I mean, is there any built in process logs to track these records? (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

6. Shell Programming and Scripting

get execution time of a script

Hi, I have a simple question. How can I get the execution time of a script and maybe put it in a variable? Another question. How can I get only time and not date and put it in a variable? I tried something with "date" command but with no success... If someone could help me... (8 Replies)
Discussion started by: Moumou
8 Replies

7. Shell Programming and Scripting

time of execution of script

i want to test whether a script has been executed in last 15 days or not....please help how can i do this...is there any copmmand there to know timings of last execution of any script (8 Replies)
Discussion started by: arghya_owen
8 Replies

8. Shell Programming and Scripting

script execution time calculation

I am writting a script in the ksh shell and am trying to find a way to report the total execution time of the script without requiring the user to specify the time function when executing the script. Does anyone have any examples they have used. I have been setting up two date variables (one at... (9 Replies)
Discussion started by: johnsonbryce
9 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
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-adfpqr] [-c command] [file] DESCRIPTION
script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. Option: -a Append the output to file or typescript, retaining the prior contents. -c command Run the named command instead of the shell. Useful for capturing the output of a program that behaves differently when associated with a tty. -d When playing back a session with the -p flag, don't sleep between records when playing back a timestamped session. -f Flush output after each write. This is useful for watching the script output in real time. -p Play back a session recorded with the -r flag in real time. -q Be quiet, and don't output started and ended lines. -r Record a session with input, output, and timestamping. The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal. ENVIRONMENT
The following environment variable is used by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism). HISTORY
The script command appeared in 3.0BSD. BUGS
script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. BSD
October 17, 2009 BSD