hi,
how can i measure the accurate run time of a program by writing a shell script? Like I want to use some for loop and run some samples and then i want to subtract the end_time-start_time to get the duration and thereby average.
johndoe444 1 Posting Whiz in Training
Recommended Answers
Jump to PostGoogled:
If you want more user friendly "time" instead of system & user times..
#!/bin/bash START=$(date +%s) # do something # start your script work here ls -R /etc > /tmp/x rm -f /tmp/x # your logic ends here END=$(date +%s) DIFF=$(( $END - $START )) …
All 4 Replies
cfajohnson 7 Shell scripter and author
thekashyap 193 Practically a Posting Shark
cfajohnson 7 Shell scripter and author
thekashyap 193 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.