Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How long does my program take to run ?

Status
Not open for further replies.

lne

Aerospace
Feb 17, 2003
1
i need to know, in fractions of a second, how long my script/program takes to run. i've already tried the "time" and "date" commands, but i only get increments of whole seconds.

any suggestions would be most welcomed !
 
Replies continue below

Recommended for you

How about this script ? Let the program runs 500 times . Thus u can see the time .

#!/bin/sh
i=0
while [ $i -lt 500 ]
do
who >& /dev/null
i=`expr $i + 1`
done
exit 1
 
Sorry , this might be fit for you .

#!/bin/sh
i=0
while [ $i -lt 500 ]
do
./yourProgram
i=`expr $i + 1`
done
exit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor