05-03-2017
I'm not sure if his requirement is rigid, but he did say he needed to reflect the elapsed time "inside" his script. If he misspoke, then time is what I'd use and your solution looks nice.
10 More Discussions You Might Find Interesting
1. Programming
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
2. UNIX for Dummies Questions & Answers
is there a command in Solaris 8 that will show a particular scripts last execution time? (1 Reply)
Discussion started by: cubs0729
1 Replies
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. UNIX for Dummies Questions & Answers
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
7. Shell Programming and Scripting
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
8. UNIX for Dummies Questions & Answers
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
LEARN ABOUT OSX
mpi_wtime
MPI_Wtime(3OpenMPI) MPI_Wtime(3OpenMPI)
NAME
MPI_Wtime - Returns an elapsed time on the calling processor.
SYNTAX
C Syntax
#include <mpi.h>
double MPI_Wtime()
Fortran Syntax
INCLUDE 'mpif.h'
DOUBLE PRECISION MPI_WTIME()
C++ Syntax
#include <mpi.h>
double Wtime()
RETURN VALUE
Time in seconds since an arbitrary time in the past.
DESCRIPTION
MPI_Wtime returns a floating-point number of seconds, representing elapsed wall-clock time since some time in the past.
The "time in the past" is guaranteed not to change during the life of the process. The user is responsible for converting large numbers of
seconds to other units if they are preferred.
This function is portable (it returns seconds, not "ticks"), it allows high resolution, and carries no unnecessary baggage. One would use
it like this:
{
double starttime, endtime;
starttime = MPI_Wtime();
.... stuff to be timed ...
endtime = MPI_Wtime();
printf("That took %f seconds
",endtime-starttime);
}
The times returned are local to the node that called them. There is no requirement that different nodes return the "same" time.
NOTES
The boolean variable MPI_WTIME_IS_GLOBAL, a predefined attribute key that indicates whether clocks are synchronized, does not have a valid
value in Open MPI, as the clocks are not guaranteed to be synchronized.
This is intended to be a high-resolution, elapsed (or wall) clock. See MPI_Wtick to determine the resolution of MPI_Wtime.
This function does not return an error value. Consequently, the result of calling it before MPI_Init or after MPI_Finalize is undefined.
SEE ALSO
MPI_Wtick
Open MPI 1.2 September 2006 MPI_Wtime(3OpenMPI)